Closed roma0615 closed 6 years ago
Using unwrap_or
is a good idea, however I don't understand why the other changes are necessary. Could you provide some information about your environment (rust toolchain) and the compiler errors that this fixes?
Running rustup show
gave me this result:
Default host: x86_64-apple-darwin
installed toolchains
--------------------
stable-x86_64-apple-darwin
nightly-x86_64-apple-darwin
active toolchain
----------------
stable-x86_64-apple-darwin (default)
rustc 1.25.0 (84203cac6 2018-03-25)
So I'm using the stable-x86_64-apple-darwin
toolchain. Should I try running rustup update
?
Yes, try that. The latest stable
is
rustc 1.27.2 (58cc626de 2018-07-18)
We don't care about supporting older releases because this is not a library. Until recently most stuff in the rust ecosystem only built on the latest nightly anyway. We're lucky that rust-clippy is finally coming to stable.
After updating to the latest stable and checking out result-parse
, the code compiled. I will make sure to update rust more often in the future!
I still think we could keep the unwrap_or
change, so I'll push another change to this branch removing the borrowing related changes that I made. Then we could squash when merging to result-parse
to clean up the history.
@roma0615 perfect 💯
These are the changes I made to get the code to compile on my computer. I also thought it would make more sense to use
unwrap_or
instead of a match statement.