by nulldata · 12y ago · 0 comments
let first_character = match line.chars().next() {
Some( v ) => v,
None => return
}
match first_character {
'# => println!("Comment"),
...
} 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.