I'm trying to get something like the following to work, and having trouble. I want the "inner" field on the parent Foo struct to be Option, but want OptionalFoo to be OptionalInner. I think the rename attribute isnt getting inside the option in my inner field declaration?
This all works fine if i just let Foo {inner:Foo}, but curious if there is a way to get this working too.
this expression has type (&mut Option<Inner>, OptionalInner)
= note: expected struct OptionalInner
found enum Option<_>
= note: this error originates in the attribute macro optional_struct (in Nightly builds, run with -Z macro-backtrace for more info)
I'm trying to get something like the following to work, and having trouble. I want the "inner" field on the parent Foo struct to be Option, but want OptionalFoo to be OptionalInner. I think the rename attribute isnt getting inside the option in my inner field declaration?
This all works fine if i just let Foo {inner:Foo}, but curious if there is a way to get this working too.
OptionalInner
, foundOption<_>
(&mut Option<Inner>, OptionalInner)
= note: expected struct
OptionalInner
found enumOption<_>
= note: this error originates in the attribute macrooptional_struct
(in Nightly builds, run with -Z macro-backtrace for more info)