linutil icon indicating copy to clipboard operation
linutil copied to clipboard

Fixed some Rust code structure and modified the workflow to fail if clippy returns warnings

Open adamperkowski opened this issue 1 year ago • 4 comments

Type of Change

  • [x] Refactoring

Description

Changed the unnecessary then & unwrap_or to an if statement. Modified the Rust workflow to fail if clippy returns warnings

Checklist

  • [x] My code adheres to the coding and style guidelines of the project.
  • [x] I have performed a self-review of my own code.
  • [x] My changes generate no errors/warnings/merge conflicts.

adamperkowski avatar Sep 20 '24 18:09 adamperkowski

Making the title variable mutable and appending the " [Multi-Select]" str afterwards would probably be more readable.

lj3954 avatar Sep 20 '24 21:09 lj3954

Making the title variable mutable and appending the " [Multi-Select]" str afterwards would probably be more readable.

Doing it like this may be less readable but it's better for the code. title doesn't need to be mutable.

adamperkowski avatar Sep 20 '24 21:09 adamperkowski

If you want to avoid mutability, you could perhaps try something like this instead: https://github.com/lj3954/linutil/commit/8d7f2b7455b9183ab70c40d9a58a58591d4f4938.

lj3954 avatar Sep 20 '24 22:09 lj3954

If you want to avoid mutability, you could perhaps try something like this instead: lj3954@8d7f2b7.

Good idea. Thanks.

adamperkowski avatar Sep 20 '24 23:09 adamperkowski