You can tell a great explanation from a middling one when at the end you go "wait, THIS is what I wasn't getting?" instead of "oh, I think I understand now". Really well-thought-out demo; thanks!
Just a thought, if u wanted to just read from a file (which is what File::open is used for if i understand correctly), then maby often its not required to actually create one, and if you wanted to write/append to a file, then OpenOptions has .create().append(true).open() unless you want to handle the special case when file does not exist. if so, OpenOption alternative seem to have less nesting, but perhaps this alternative opens up for more kinds of error handling and less convention. But im just beginner so i dont know whats best practice
We need method aliasing so that we can rename unwrap() on Option and Result to match()... I can almost guarantee that's where 1/2 fail. Mind is trying to figure out what's being "unwrapped" (there's nothing to unwrap...). Or maybe name it "assert_get_val" for Option and "assert_get_result" for Result. Nah - that's too crazy. maybe just "match". Now that we have ?, it doesn't matter much.
You can tell a great explanation from a middling one when at the end you go "wait, THIS is what I wasn't getting?" instead of "oh, I think I understand now". Really well-thought-out demo; thanks!
Unwraps are also good to use in tests for things that should be there. If it panics, the test will fail!
this is by far the best explanation of error handling in rust ever
13:35 ... and use a really cool feature inside Swift
13:37 should be rust not swift - great vid. thank you
Yes. That is my mistake.
@@TheDevMethodamazing ironic timing though
Just a thought, if u wanted to just read from a file (which is what File::open is used for if i understand correctly), then maby often its not required to actually create one, and if you wanted to write/append to a file, then OpenOptions has .create().append(true).open() unless you want to handle the special case when file does not exist. if so, OpenOption alternative seem to have less nesting, but perhaps this alternative opens up for more kinds of error handling and less convention. But im just beginner so i dont know whats best practice
and how to raise a custom error when you are using the Box method ?
Does anyone know he font? Looks really slick!
I usually use Fira Mono
wow really great explanation!
What's your theme?
Do you know why kind() isn’t available in anyhow? That’s useful
Thank you
13:30 swift?
subscribed
We need method aliasing so that we can rename unwrap() on Option and Result to match()...
I can almost guarantee that's where 1/2 fail. Mind is trying to figure out what's being "unwrapped" (there's nothing to unwrap...).
Or maybe name it "assert_get_val" for Option and "assert_get_result" for Result.
Nah - that's too crazy. maybe just "match".
Now that we have ?, it doesn't matter much.
why on earth everything becomes overly complicated when it comes to rust?
way too verbose... man, it's just error handling!
Better than try catch hell and functions unexpectedly throwing exceptions. Errors should be values and should be easy to see where they can occur
Zoom in gosh