rustbus icon indicating copy to clipboard operation
rustbus copied to clipboard

MessageParser::get should handle variants specially

Open KillingSpark opened this issue 3 years ago • 0 comments

#82 brought to light that variants are not very userfriendly

  • Either get() could check if the next value is a variant and do "the right thing" but I'll have to think about whether this has any edge cases that would break if I do this.
  • Or I could introduce a get_variant() that works similarly to get() which essentially wraps the get::<Variant>()?.get::<MyType>()

In any case, users should rarely have to actually call get::<Variant>()

KillingSpark avatar Jan 25 '23 21:01 KillingSpark