Re:First taste of Rust
by nulldata on Thursday July 31, 2014 @09:38AM
(#8113945)
Nice article though some of the code is less elegant than it could be, normally you would match the option to unwrap it and then match it's value, instead of doing a lot of 'Some( .. )' matches.
[ Parent
| on HN ]
Re:First taste of Rust
by PudgePacket on Friday August 01, 2014 @01:21AM
(#8118475)
I played around with a few different configurations for that particular part, even having something similar to yours that looked like
match line.chars().next() {
Some(x) => match x {
'#' => ...
'v' => ...
_ => ...
},
None => ...
}
But I felt that the current approach was fine. At this point it becomes more a decision of style and taste vs any kind of practicality.