It doesn't seem to be bad at all. There are always nitpicks like an unecessary .to_string() before parsing and type hint that would have been inferred, but it looks like pretty standard Rust code.
Though I do wonder, if you wanted to write a Perl solution, why not fork it in that language directly?
Just so you know, the purpose of .expect("text goes here") is to provide context if the unwrap panics. If you don't feel the need to provide context, a simple .unwrap() makes more sense.
It doesn't seem to be bad at all. There are always nitpicks like an unecessary
.to_string()
before parsing and type hint that would have been inferred, but it looks like pretty standard Rust code.Though I do wonder, if you wanted to write a Perl solution, why not fork it in that language directly?
Thanks, I'm really not very good at Rust as you can probably tell.
Just so you know, the purpose of
.expect("text goes here")
is to provide context if the unwrap panics. If you don't feel the need to provide context, a simple.unwrap()
makes more sense.damn, the standard library...
ah yes the DRY principle... what if we will need to use it again?
that was ez
This is my first time use codewar. Any suggets what should i do next?
same, this is my first time use codewar. Any suggets what should i do next?
it wasnt clear to me at first that the memory was already allocated lol
yo this one is real hard