• ddh@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    166
    arrow-down
    12
    ·
    2 years ago

    As your future colleague wondering what the hell that variable is for, thanks Go.

    • Nioxic@lemmy.world
      link
      fedilink
      English
      arrow-up
      22
      arrow-down
      1
      ·
      2 years ago

      Isnt the syntax highlighting it as mever used?

      So why would they wonder?

      • Camilo@discuss.tchncs.de
        link
        fedilink
        arrow-up
        1
        arrow-down
        3
        ·
        2 years ago

        If it is a pure value, I’d assume yes, but if it is tied to a side effect (E.g. write its value to a file), then it would be not used but still could break your app if removed.

        I’m not familiar with rust language specifically, but generally that’s what could happen

    • MJBrune@beehaw.org
      link
      fedilink
      English
      arrow-up
      19
      arrow-down
      2
      ·
      2 years ago

      A quick “find all references” will point out it’s not used and can be deleted if it accidentally gets checked in but ideally, you have systems in place to not let it get checked into the main branch in the first place.