Skip to content
Snippets Groups Projects

Improvements prompted by clippy, and disable one lint

Merged Ian Jackson requested to merge Diziet/arti:clippy into main
  1. May 11, 2022
    • Ian Jackson's avatar
      clippy: Change a binding to (), and allow clippy::let_unit_value · 0cc94d44
      Ian Jackson authored
      The type of ret.map_err(codec_err_to_chan)? is ().  ISTM that
      writing `let () = ` makes it clear that there is nothing there,
      but the lint forbids this.
      
      This lint is warn by default and trips here for me on current nightly.
      
      It seems wrong to me.  We should be able to make it clear to the
      reader that there is nothing here - note how this differs from the
      lines below where Ready contains msg.  A let () binding is a good way
      to do that.
      
      I think the lint allow ought to be added everywhere, but that doesn't
      seem easy right now - see this issue about maint/add_warning:
         tpo/core/arti#469
      0cc94d44
    • Ian Jackson's avatar
      clippy: Use write! rather than push_str, format · 07175957
      Ian Jackson authored
      This does involve unwrap, but of course that can't fail unless the
      formats fail, which would already panic (that's implied by format!).
      07175957
    • Ian Jackson's avatar
      clippy: Drop an unused lifetime · 4a06ce01
      Ian Jackson authored
      4a06ce01
Loading