Rust: Error Handling

Поделиться
HTML-код
  • Опубликовано: 13 сен 2024

Комментарии • 22

  • @UliTroyo
    @UliTroyo Год назад +8

    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!

  • @josephlyons3393
    @josephlyons3393 Год назад +10

    Unwraps are also good to use in tests for things that should be there. If it panics, the test will fail!

  • @OuranianCyclops
    @OuranianCyclops Год назад +2

    this is by far the best explanation of error handling in rust ever

  • @zeroows
    @zeroows 2 года назад +6

    13:37 should be rust not swift - great vid. thank you

  • @antonaparin
    @antonaparin Год назад +1

    13:35 ... and use a really cool feature inside Swift

  • @anderslundstrom4388
    @anderslundstrom4388 2 года назад +1

    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

  • @AliBigdeli
    @AliBigdeli 8 месяцев назад

    and how to raise a custom error when you are using the Box method ?

  • @FugalBaboon
    @FugalBaboon Год назад +1

    wow really great explanation!

  • @fabienpenso
    @fabienpenso 2 года назад

    Do you know why kind() isn’t available in anyhow? That’s useful

  • @PimpofChaos
    @PimpofChaos Год назад +3

    Does anyone know he font? Looks really slick!

  • @apidas
    @apidas Год назад +2

    subscribed

  • @alexandredaubricourt5741
    @alexandredaubricourt5741 Год назад

    What's your theme?

  • @scigama71
    @scigama71 8 месяцев назад

    Thank you

  • @NighthunterNyx
    @NighthunterNyx 2 месяца назад

    13:30 swift?

  • @jeffg4686
    @jeffg4686 Год назад

    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.

  • @hiongun
    @hiongun Год назад

    why on earth everything becomes overly complicated when it comes to rust?
    way too verbose... man, it's just error handling!

    • @AJ213Probably
      @AJ213Probably Год назад +2

      Better than try catch hell and functions unexpectedly throwing exceptions. Errors should be values and should be easy to see where they can occur

  • @mrlectus
    @mrlectus 2 года назад

    Zoom in gosh