[−][src]Function show_notes::e021::takes_a_str
pub fn takes_a_str(_some_str: &str)
A function which takes a string, to use with Deref
and EmailStruct
.
E.g. you can do this:
let email_struct = EmailStruct("[email protected]".into()); takes_a_str(&email_struct);
And likewise, with the enum variant:
let email_enum = EmailEnum::Address("[email protected]".into()); takes_a_str(&email_enum)
Note, however, that the Deref
implementation is much more complicated
for the enum variant, as everything is in general.