• flamingo_pinyata@sopuli.xyz
    link
    fedilink
    arrow-up
    58
    ·
    4 days ago

    The whole point of it is to prevent you from doing stupid shit. Yes it’s annoying. But you can’t handle memory management on your own, no matter how much you think you can.

    It’s either that or garbage collection. Choose which one you hate less.

  • RustyNova@lemmy.world
    link
    fedilink
    arrow-up
    33
    ·
    4 days ago

    I don’t understand why people hate the borrow checker. Just make sure that you own the value until everything is done using it, or put it into a smart pointer

    • Sunrosa@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      17 hours ago

      I basically never have borrow checker issues at all anymore, and smart pointers are basically never necessary. It takes getting used to, but it stops being an obstacle with practice.

      • RustyNova@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        13 hours ago

        Yup. Although I like smart pointers due to their simplicity (unless it really needs performance), as well when dealing with tokio’s spawn (eww. Smol and future combinators are way better)

        Although trait bounds are always a bigger issue for me… probably because of my biblically accurate trait bounds