-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
The example uses a non-idiomatic way to initialize Message that requires mut.
Idiomatic would be either the builder- or the init-struct-pattern. The former is a lot of boilerplate while the latter requires only the Default trait.
I.e. instead of:
// Create a message.
let mut message = Message {
vec![Destination::new("+436764162755")]
);
message.text = Some("Foobar!".to_string());this:
// Create a message.
let message = Message {
destinations: Some(vec![Destination::new("123456789")]),
text: Some("Foobar!".to_string()),
..Default::default(),
);strosek
Metadata
Metadata
Assignees
Labels
No labels