You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0609]: no field `length` on type `Option<&Option<SvcDesc>>`
--> src/ano.rs:106:20
|
106 | #[deku(count = "Some(svc_dsc).length")]
| ^^^^^^^^^^^^^^^^^^^^^^
It doesn't like getting dereferenced or unwrapped due to the borrow checker either 😄.
I finally did figure out that you can unwrap the reference to the Option by writing this as
but it was somewhat confounding there for a bit.
Think it's worth looking at some sugar to handle options directly or at least documenting the access pattern for newcomers.
The text was updated successfully, but these errors were encountered:
Oh interesting, if this isn't in a deku derive macro you get a better error:
error[E0609]: no field `len` on type `Option<Len>`
--> examples/example.rs:16:7
|
16 | a.len;
| ^^^ unknown field
|
help: one of the expressions' fields has a field of the same name
|
16 | a.unwrap().len;
| +++++++++
When writing
the compiler can't figure out how to reference the
length
struct member fromsvc_dsc
because it's wrapped in anOption
.Since the macro notation doesn't allow use of
either due to
It doesn't like getting dereferenced or unwrapped due to the borrow checker either 😄.
I finally did figure out that you can unwrap the reference to the
Option
by writing this asbut it was somewhat confounding there for a bit.
Think it's worth looking at some sugar to handle options directly or at least documenting the access pattern for newcomers.
The text was updated successfully, but these errors were encountered: