4 ms·
In my experience, I did eventually start to appreciate the compiler forcing me to address things up-front. But as an aside, if you're just trying to prototype
by scudd 6y ago
In my experience, I did eventually start to appreciate the compiler forcing me to address things up-front.
But as an aside, if you're just trying to prototype quickly, some useful "shortcuts" can be:
- Using `Box<dyn std::error::Error>` for functions which need to handle a result
- Using `unwrap` or `expect` to easily access Option internal values
- Using `unimplemented!()` if I'm trying to mock an API design. This one is nice because it will let you build out the signature including specifying a return type without having to build out the function logic.
Obviously these are shortcuts and not production suitable, but can be good to just get some code on the page that compiles