Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all clippy and rustc warnings (beta toolchain version 0.1.75) #316

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

primeos-work
Copy link
Member

This fixes all new warnings except these two false positives (s. commit message):

$ cargo clippy --release
   Compiling butido v0.4.0
warning: unnecessary map of the identity function
  --> src/job/runnable.rs:74:59
   |
74 |                 .chain(git_author_env.as_ref().into_iter().map(|(k, v)| (k, v)))
   |                                                           ^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity
   = note: `#[warn(clippy::map_identity)]` on by default

warning: unnecessary map of the identity function
  --> src/job/runnable.rs:75:59
   |
75 |                 .chain(git_commit_env.as_ref().into_iter().map(|(k, v)| (k, v)))
   |                                                           ^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity

warning: `butido` (bin "butido") generated 2 warnings (run `cargo clippy --fix --bin "butido"` to apply 2 suggestions)
    Finished release [optimized] target(s) in 12.68s

The `LogSink` trait got introduced in 7188fc9 to abstract log sinks
(destinations). A `FileSink` implementation was added in 3ff4fee to
write logs to a file and optional support for the orchestrator was added
in d35bf6e.

It isn't needed anymore since the implementation in da12a96 stopped
relying on `FileSink` or rather `FileLogSinkFactory`.
The `log::filesink` module was then removed in `bfe392e` but `log::sink`
never got cleanup up. I noticed this now because `rustc 1.75.0-beta.1`
detected the unused import: `sink::*` in `src/log/mod.rs:18:9` via the
`unused_imports` lint.

Signed-off-by: Michael Weiss <michael.weiss@atos.net>
This got detected and "fixed" (improved) by clippy's `get_first` [0]
lint (beta toolchain version 1.75.0-beta.1).

Clippy currently shows two more warnings from the `map_identity` [1]
lint but those are false positives and a fix was already merged [2].

[0]: https://rust-lang.github.io/rust-clippy/master/index.html#/get_first
[1]: https://rust-lang.github.io/rust-clippy/master/index.html#/map_identity
[2]: rust-lang/rust-clippy#11792

Signed-off-by: Michael Weiss <michael.weiss@atos.net>
@primeos-work primeos-work added this pull request to the merge queue Nov 29, 2023
Merged via the queue into science-computing:master with commit 5f13d7f Nov 29, 2023
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant