• BartyDeCanter@piefed.social
    link
    fedilink
    English
    arrow-up
    11
    ·
    3 days ago

    Yup. I come from a mostly embedded C or C++ background with a constant 10% Python for assorted scripts. Rust feels pretty great, basically all the things I like about all of those languages with fewer of the annoyances. And cargo and clippy are fantastic. My biggest annoyance is remembering which of the approximately 213 Result/Option chain handlers I should use in a given situation.

    • magikmw@piefed.social
      link
      fedilink
      English
      arrow-up
      3
      ·
      3 days ago

      Thanks for naming my biggest problem with writing rust code. Every crate has it’s own particular Result chain, doesn’t it. To the point we have anyhow and eyre to help with this mess.

      • BartyDeCanter@piefed.social
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        2 days ago

        My current solution is usually to just make a bunch of stupid match statements and fix whatever clippy complains about. Then if any remain be sure to “accidentally“ tag the friendliest rust expert I know on the PR and see if they say anything.

        edit: They usually say something like, “you could replace those matches with a and_else, map_err, unwrap_or, and_then? and a filter_map.”