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
{{ message }}
This repository was archived by the owner on Sep 15, 2026. It is now read-only.
My solution would be to implement a getter for each item.
fnmain(){let mine = MyEnum::Foo{bar:42,baz:"In the clearing stands a boxer".to_string()};// Items are named after the enum, and then their name in snake_caseprintln!("bar is: {}", mine.foo_bar());println!("baz is: {}", mine.foo_baz());}
My only concern is that this can get wordy when using snake_case.
If you think you have something more ergonomic (or overall better!) please suggest it here.
For example,
currently does not create an implementation.
My solution would be to implement a getter for each item.
My only concern is that this can get wordy when using
snake_case.If you think you have something more ergonomic (or overall better!) please suggest it here.