Skip to content

Update README.md

Update README.md #286

Triggered via push July 15, 2025 17:17
Status Success
Total duration 2m 43s
Artifacts

quality.yml

on: push
Rust Quality Gate
2m 40s
Rust Quality Gate
Fit to window
Zoom out
Zoom in

Annotations

204 warnings
variables can be used directly in the `format!` string: src/sr/main.rs#L337
warning: variables can be used directly in the `format!` string --> src/sr/main.rs:337:9 | 337 | debug!("caps : {:?}", caps); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 337 - debug!("caps : {:?}", caps); 337 + debug!("caps : {caps:?}"); |
unneeded `return` statement: src/sr/main.rs#L309
warning: unneeded `return` statement --> src/sr/main.rs:309:5 | 309 | / return Cred::builder() 310 | | .maybe_tty(stat::fstat(stdout().as_raw_fd()).ok().and_then(|s| { 311 | | if isatty(stdout().as_raw_fd()).ok().unwrap_or(false) { 312 | | Some(s.st_rdev) ... | 316 | | })) 317 | | .build(); | |________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 309 ~ Cred::builder() 310 + .maybe_tty(stat::fstat(stdout().as_raw_fd()).ok().and_then(|s| { 311 + if isatty(stdout().as_raw_fd()).ok().unwrap_or(false) { 312 + Some(s.st_rdev) 313 + } else { 314 + None 315 + } 316 + })) 317 ~ .build() |
variables can be used directly in the `format!` string: src/sr/main.rs#L299
warning: variables can be used directly in the `format!` string --> src/sr/main.rs:299:13 | 299 | error!("{}", e); | ^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 299 - error!("{}", e); 299 + error!("{e}"); |
variables can be used directly in the `format!` string: src/sr/main.rs#L223
warning: variables can be used directly in the `format!` string --> src/sr/main.rs:223:9 | 223 | println!("{}", USAGE); | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 223 - println!("{}", USAGE); 223 + println!("{USAGE}"); |
variables can be used directly in the `format!` string: src/sr/main.rs#L217
warning: variables can be used directly in the `format!` string --> src/sr/main.rs:217:9 | 217 | println!("{}", USAGE); | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 217 - println!("{}", USAGE); 217 + println!("{USAGE}"); |
useless conversion to the same type: `std::option::Option<rootasrole_core::database::actor::SGroups>`: src/sr/main.rs#L144
warning: useless conversion to the same type: `std::option::Option<rootasrole_core::database::actor::SGroups>` --> src/sr/main.rs:144:25 | 144 | group = iter | _________________________^ 145 | | .next() 146 | | .map(|s| { 147 | | SGroups::Multiple( ... | 153 | | }) 154 | | .into(); | |___________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion help: consider removing `.into()` | 144 ~ group = iter 145 + .next() 146 + .map(|s| { 147 + SGroups::Multiple( 148 + s.as_ref() 149 + .split(',') 150 + .map(|g| g.into()) 151 + .collect::<Vec<SGroupType>>(), 152 + ) 153 ~ }); |
variables can be used directly in the `format!` string: src/sr/main.rs#L118
warning: variables can be used directly in the `format!` string --> src/sr/main.rs:118:5 | 118 | / format!( 119 | | "Unable to toggle {} privilege. {}", 120 | | caplist, CAPABILITIES_ERROR 121 | | ) | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: src/sr/timeout.rs#L265
warning: variables can be used directly in the `format!` string --> src/sr/timeout.rs:265:13 | 265 | debug!("Updating cookie: {:?}", cookie); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 265 - debug!("Updating cookie: {:?}", cookie); 265 + debug!("Updating cookie: {cookie:?}"); |
variables can be used directly in the `format!` string: src/sr/timeout.rs#L238
warning: variables can be used directly in the `format!` string --> src/sr/timeout.rs:238:9 | 238 | debug!("Failed to save cookies {:?}", e); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 238 - debug!("Failed to save cookies {:?}", e); 238 + debug!("Failed to save cookies {e:?}"); |
variables can be used directly in the `format!` string: src/sr/timeout.rs#L224
warning: variables can be used directly in the `format!` string --> src/sr/timeout.rs:224:17 | 224 | debug!("Time of use: {}, max_usage : {}", timeofuse, max_usage_ok); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 224 - debug!("Time of use: {}, max_usage : {}", timeofuse, max_usage_ok); 224 + debug!("Time of use: {timeofuse}, max_usage : {max_usage_ok}"); |
variables can be used directly in the `format!` string: src/sr/timeout.rs#L212
warning: variables can be used directly in the `format!` string --> src/sr/timeout.rs:212:17 | 212 | debug!("Checking cookie: {:?}", cookie); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 212 - debug!("Checking cookie: {:?}", cookie); 212 + debug!("Checking cookie: {cookie:?}"); |
variables can be used directly in the `format!` string: src/sr/timeout.rs#L191
warning: variables can be used directly in the `format!` string --> src/sr/timeout.rs:191:9 | 191 | debug!("Failed to remove lockfile: {}", err); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 191 - debug!("Failed to remove lockfile: {}", err); 191 + debug!("Failed to remove lockfile: {err}"); |
variables can be used directly in the `format!` string: src/sr/timeout.rs#L182
warning: variables can be used directly in the `format!` string --> src/sr/timeout.rs:182:5 | 182 | debug!("Saving cookies: {:?}", cookies); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 182 - debug!("Saving cookies: {:?}", cookies); 182 + debug!("Saving cookies: {cookies:?}"); |
variables can be used directly in the `format!` string: src/sr/timeout.rs#L121
warning: variables can be used directly in the `format!` string --> src/sr/timeout.rs:121:9 | 121 | / debug!( 122 | | "Lockfile located at {:?} was not found, continuing...", 123 | | lockfile_path 124 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: src/sr/timeout.rs#L114
warning: variables can be used directly in the `format!` string --> src/sr/timeout.rs:114:13 | 114 | / debug!( 115 | | "Lockfile located at {:?} was not found, continuing...", 116 | | lockfile_path 117 | | ); | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: src/sr/timeout.rs#L100
warning: variables can be used directly in the `format!` string --> src/sr/timeout.rs:100:17 | 100 | / debug!( 101 | | "Lockfile located at {:?} is empty, continuing...", 102 | | lockfile_path 103 | | ); | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/pam/mod.rs#L141
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/pam/mod.rs:141:40 | 141 | timeout::update_cookie(user, user, &timeout)?; | ^^^^^^^^ help: change this to: `timeout` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/pam/mod.rs#L132
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/pam/mod.rs:132:50 | 132 | let is_valid = timeout::is_valid(user, user, &timeout); | ^^^^^^^^ help: change this to: `timeout` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
variables can be used directly in the `format!` string: src/sr/pam/mod.rs#L65
warning: variables can be used directly in the `format!` string --> src/sr/pam/mod.rs:65:29 | 65 | .build(&format!("^{}'s Password: ?$", username)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 65 - .build(&format!("^{}'s Password: ?$", username)) 65 + .build(&format!("^{username}'s Password: ?$")) |
calling .bytes() is very inefficient when data is not in memory: src/sr/pam/rpassword.rs#L82
warning: calling .bytes() is very inefficient when data is not in memory --> src/sr/pam/rpassword.rs:82:17 | 82 | let input = source.bytes().take_while(|x| x.as_ref().ok() != Some(&EOL)); | ^^^^^^^^^^^^^^ | = help: consider using `BufReader` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unbuffered_bytes = note: `#[warn(clippy::unbuffered_bytes)]` on by default
variables can be used directly in the `format!` string: src/sr/finder/mod.rs#L251
warning: variables can be used directly in the `format!` string --> src/sr/finder/mod.rs:251:9 | 251 | debug!("env_path: {:?}", env_path); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 251 - debug!("env_path: {:?}", env_path); 251 + debug!("env_path: {env_path:?}"); |
using `clone` on type `Option<CapSet>` which implements the `Copy` trait: src/sr/finder/mod.rs#L237
warning: using `clone` on type `Option<CapSet>` which implements the `Copy` trait --> src/sr/finder/mod.rs:237:25 | 237 | self.caps = data.caps.clone(); | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `data.caps` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[warn(clippy::clone_on_copy)]` on by default
using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`: src/sr/finder/mod.rs#L233
warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` --> src/sr/finder/mod.rs:233:30 | 233 | self.setgroups = data.setgroups.clone().and_then(|g| match g { | ______________________________^ 234 | | DGroups::Single(g) => Some(vec![g.fetch_id()].into_iter().flatten().collect()), 235 | | DGroups::Multiple(g) => Some(g.iter().filter_map(|g| g.fetch_id()).collect()), 236 | | }); | |______________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map help: use `map` instead | 233 ~ self.setgroups = data.setgroups.clone().map(|g| match g { 234 ~ DGroups::Single(g) => vec![g.fetch_id()].into_iter().flatten().collect(), 235 ~ DGroups::Multiple(g) => g.iter().filter_map(|g| g.fetch_id()).collect(), |
called `map(..).flatten()` on `Option`: src/sr/finder/mod.rs#L232
warning: called `map(..).flatten()` on `Option` --> src/sr/finder/mod.rs:232:47 | 232 | self.setuid = data.setuid.clone().map(|u| u.fetch_id()).flatten(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|u| u.fetch_id())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/mod.rs#L220
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/mod.rs:220:19 | 220 | &cli, &data, opt_stack, self, &mut score, | ^^^^^ help: change this to: `data` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/mod.rs#L220
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/mod.rs:220:13 | 220 | &cli, &data, opt_stack, self, &mut score, | ^^^^ help: change this to: `cli` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
variables can be used directly in the `format!` string: src/sr/finder/mod.rs#L215
warning: variables can be used directly in the `format!` string --> src/sr/finder/mod.rs:215:13 | 215 | debug!("final_path already found: {:?}", final_path); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 215 - debug!("final_path already found: {:?}", final_path); 215 + debug!("final_path already found: {final_path:?}"); |
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/mod.rs#L103
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/mod.rs:103:17 | 103 | &env_path, | ^^^^^^^^^ help: change this to: `env_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/mod.rs#L84
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/mod.rs:84:17 | 84 | &env_path, | ^^^^^^^^^ help: change this to: `env_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this pattern creates a reference to a reference: src/sr/finder/options.rs#L971
warning: this pattern creates a reference to a reference --> src/sr/finder/options.rs:971:9 | 971 | ref is_safe => { | ^^^^^^^^^^^ help: try: `is_safe` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/options.rs#L831
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/options.rs:831:25 | 831 | .opt_filter(&opt_filter) | ^^^^^^^^^^^ help: change this to: `opt_filter` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/options.rs#L793
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/options.rs:793:17 | 793 | &default_behavior, | ^^^^^^^^^^^^^^^^^ help: change this to: `default_behavior` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/options.rs#L790
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/options.rs:790:17 | 790 | &opt_filter, | ^^^^^^^^^^^ help: change this to: `opt_filter` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this lifetime isn't used in the function definition: src/sr/finder/options.rs#L746
warning: this lifetime isn't used in the function definition --> src/sr/finder/options.rs:746:37 | 746 | fn determine_final_behavior<'a>( | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`: src/sr/finder/options.rs#L715
warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` --> src/sr/finder/options.rs:715:36 | 715 | .env_behavior(&o.env.as_ref().and_then(|e| Some(e.default_behavior))) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `o.env.as_ref().map(|e| e.default_behavior)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map = note: `#[warn(clippy::bind_instead_of_map)]` on by default
this pattern creates a reference to a reference: src/sr/finder/options.rs#L691
warning: this pattern creates a reference to a reference --> src/sr/finder/options.rs:691:25 | 691 | if let Some(ref path_opt) = opt { | ^^^^^^^^^^^^ help: try: `path_opt` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`: src/sr/finder/options.rs#L697
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` --> src/sr/finder/options.rs:697:54 | 697 | &path_opt.sub.as_ref().map(|v| v.into_iter()), | ^^^^^^^^^ help: call directly: `iter` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`: src/sr/finder/options.rs#L696
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` --> src/sr/finder/options.rs:696:54 | 696 | &path_opt.add.as_ref().map(|v| v.into_iter()), | ^^^^^^^^^ help: call directly: `iter` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
unnecessary `if let` since only the `Some` variant of the iterator element is used: src/sr/finder/options.rs#L690
warning: unnecessary `if let` since only the `Some` variant of the iterator element is used --> src/sr/finder/options.rs:690:9 | 690 | for opt in stack.iter() { | ^ ------------ help: try: `stack.iter().flatten()` | _________| | | 691 | | if let Some(ref path_opt) = opt { 692 | | calculate_combined_paths( 693 | | path_var, ... | 700 | | } | |_________^ | help: ...and remove the `if let` statement in the for loop --> src/sr/finder/options.rs:691:13 | 691 | / if let Some(ref path_opt) = opt { 692 | | calculate_combined_paths( 693 | | path_var, 694 | | &mut combined_paths, ... | 698 | | ); 699 | | } | |_____________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten = note: `#[warn(clippy::manual_flatten)]` on by default
called `map(..).flatten()` on `Option`: src/sr/finder/options.rs#L679
warning: called `map(..).flatten()` on `Option` --> src/sr/finder/options.rs:679:32 | 679 | self.task.as_ref().map(|c| c.path.as_ref()).flatten(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|c| c.path.as_ref())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
called `map(..).flatten()` on `Option`: src/sr/finder/options.rs#L678
warning: called `map(..).flatten()` on `Option` --> src/sr/finder/options.rs:678:32 | 678 | self.role.as_ref().map(|c| c.path.as_ref()).flatten(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|c| c.path.as_ref())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
called `map(..).flatten()` on `Option`: src/sr/finder/options.rs#L677
warning: called `map(..).flatten()` on `Option` --> src/sr/finder/options.rs:677:34 | 677 | self.config.as_ref().map(|c| c.path.as_ref()).flatten(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|c| c.path.as_ref())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
this lifetime isn't used in the impl: src/sr/finder/options.rs#L647
warning: this lifetime isn't used in the impl --> src/sr/finder/options.rs:647:10 | 647 | impl<'a, 'b, 'c, 't> BorrowedOptStack<'a> { | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default
the borrowed expression implements the required traits: src/sr/finder/options.rs#L515
warning: the borrowed expression implements the required traits --> src/sr/finder/options.rs:515:64 | 515 | set.contains(&needle) || set.iter().any(|key| test_pattern(&needle, key.as_ref())) | ^^^^^^^ help: change this to: `needle` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/options.rs#L515
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/options.rs:515:18 | 515 | set.contains(&needle) || set.iter().any(|key| test_pattern(&needle, key.as_ref())) | ^^^^^^^ help: change this to: `needle` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/options.rs#L491
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/options.rs:491:44 | 491 | .extend_from_slice(&sub); | ^^^^ help: change this to: `sub` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/options.rs#L485
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/options.rs:485:44 | 485 | .extend_from_slice(&add); | ^^^^ help: change this to: `add` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
you are using an explicit closure for copying elements: src/sr/finder/options.rs#L441
warning: you are using an explicit closure for copying elements --> src/sr/finder/options.rs:441:18 | 441 | .sub(ENV_PATH_REMOVE_LIST_SLICE.iter().map(|p| *p)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `ENV_PATH_REMOVE_LIST_SLICE.iter().copied()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
you are using an explicit closure for copying elements: src/sr/finder/options.rs#L440
warning: you are using an explicit closure for copying elements --> src/sr/finder/options.rs:440:18 | 440 | .add(ENV_PATH_ADD_LIST_SLICE.iter().map(|p| *p)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `ENV_PATH_ADD_LIST_SLICE.iter().copied()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone = note: `#[warn(clippy::map_clone)]` on by default
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`: src/sr/finder/options.rs#L431
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` --> src/sr/finder/options.rs:431:32 | 431 | .map(|v| v.into_iter().map(|s| s.to_string()).collect::<Vec<_>>()), | ^^^^^^^^^ help: call directly: `iter` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`: src/sr/finder/options.rs#L427
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` --> src/sr/finder/options.rs:427:32 | 427 | .map(|v| v.into_iter().map(|s| s.to_string()).collect::<Vec<_>>()), | ^^^^^^^^^ help: call directly: `iter` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true: src/sr/finder/options.rs#L422
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/sr/finder/options.rs:422:1 | 422 | impl Into<SPathOptions> for DPathOptions<'_> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into help: replace the `Into` implementation with `From<finder::options::DPathOptions<'_>>` | 422 ~ impl From<DPathOptions<'_>> for SPathOptions { 423 ~ fn from(val: DPathOptions<'_>) -> Self { 424 ~ SPathOptions::builder(val.default_behavior) 425 | .maybe_add( 426 ~ val.add 427 | .map(|v| v.into_iter().map(|s| s.to_string()).collect::<Vec<_>>()), 428 | ) 429 | .maybe_sub( 430 ~ val.sub |
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`: src/sr/finder/options.rs#L370
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` --> src/sr/finder/options.rs:370:44 | 370 | ... .map(|v| v.into_iter().map(|s| s.to_string()).collect::<Vec<_>>()), | ^^^^^^^^^ help: call directly: `iter` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`: src/sr/finder/options.rs#L365
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` --> src/sr/finder/options.rs:365:44 | 365 | ... .map(|v| v.into_iter().map(|s| s.to_string()).collect::<Vec<_>>()), | ^^^^^^^^^ help: call directly: `iter` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref = note: `#[warn(clippy::into_iter_on_ref)]` on by default
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true: src/sr/finder/options.rs#L356
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true --> src/sr/finder/options.rs:356:1 | 356 | impl Into<rar_common::database::options::Opt> for Opt<'_> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into = note: `#[warn(clippy::from_over_into)]` on by default help: replace the `Into` implementation with `From<finder::options::Opt<'_>>` | 356 ~ impl From<Opt<'_>> for rar_common::database::options::Opt { 357 ~ fn from(val: Opt<'_>) -> Self { 358 ~ rar_common::database::options::Opt::builder(val.level) 359 ~ .maybe_path(if let Some(spath) = val.path { 360 | Some( ... 376 | }) 377 ~ .maybe_env(if let Some(senv) = val.env { 378 | Some( ... 412 | }) 413 ~ .maybe_root(val.root) 414 ~ .maybe_bounding(val.bounding) 415 ~ .maybe_authentication(val.authentication) 416 ~ .maybe_wildcard_denied(val.wildcard_denied) 417 ~ .maybe_timeout(val.timeout) |
variables can be used directly in the `format!` string: src/sr/finder/options.rs#L332
warning: variables can be used directly in the `format!` string --> src/sr/finder/options.rs:332:21 | 332 | format!("{}:{}", acc, path) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 332 - format!("{}:{}", acc, path) 332 + format!("{acc}:{path}") |
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/de.rs#L1441
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/de.rs:1441:35 | 1441 | if cmd_min.better(&self.cmd_min) { | ^^^^^^^^^^^^^ help: change this to: `self.cmd_min` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
variables can be used directly in the `format!` string: src/sr/finder/de.rs#L1432
warning: variables can be used directly in the `format!` string --> src/sr/finder/de.rs:1432:17 | 1432 | debug!("DCommandVisitor: command {}", v); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 1432 - debug!("DCommandVisitor: command {}", v); 1432 + debug!("DCommandVisitor: command {v}"); |
unneeded `return` statement: src/sr/finder/de.rs#L1271
warning: unneeded `return` statement --> src/sr/finder/de.rs:1271:17 | 1271 | / return Ok(DCommandList { 1272 | | default_behavior: Some(if v { 1273 | | SetBehavior::All 1274 | | } else { ... | 1278 | | del: Cow::Borrowed(&[]), 1279 | | }); | |__________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 1271 ~ Ok(DCommandList { 1272 + default_behavior: Some(if v { 1273 + SetBehavior::All 1274 + } else { 1275 + SetBehavior::None 1276 + }), 1277 + add: Cow::Borrowed(&[]), 1278 + del: Cow::Borrowed(&[]), 1279 ~ }) |
unneeded `return` statement: src/sr/finder/de.rs#L1260
warning: unneeded `return` statement --> src/sr/finder/de.rs:1260:17 | 1260 | / return Ok(DCommandList { 1261 | | default_behavior: None, 1262 | | add: Cow::Owned(add), 1263 | | del: Cow::Borrowed(&[]), 1264 | | }); | |__________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 1260 ~ Ok(DCommandList { 1261 + default_behavior: None, 1262 + add: Cow::Owned(add), 1263 + del: Cow::Borrowed(&[]), 1264 ~ }) |
useless conversion to the same type: `rootasrole_core::database::actor::DUserType<'_>`: src/sr/finder/de.rs#L1127
warning: useless conversion to the same type: `rootasrole_core::database::actor::DUserType<'_>` --> src/sr/finder/de.rs:1127:49 | 1127 | ... user = Some(value.into()); | ^^^^^^^^^^^^ help: consider removing `.into()`: `value` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
called `map(..).flatten()` on `Option`: src/sr/finder/de.rs#L1090
warning: called `map(..).flatten()` on `Option` --> src/sr/finder/de.rs:1090:64 | 1090 | if let Some(y) = &self.cli.opt_filter.as_ref().map(|x| x.user).flatten() { | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|x| x.user)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
called `map(..).flatten()` on `Option`: src/sr/finder/de.rs#L1068
warning: called `map(..).flatten()` on `Option` --> src/sr/finder/de.rs:1068:64 | 1068 | if let Some(y) = &self.cli.opt_filter.as_ref().map(|x| x.user).flatten() { | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|x| x.user)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
called `map(..).flatten()` on `Option`: src/sr/finder/de.rs#L1038
warning: called `map(..).flatten()` on `Option` --> src/sr/finder/de.rs:1038:64 | 1038 | if let Some(y) = &self.cli.opt_filter.as_ref().map(|x| x.user).flatten() { | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|x| x.user)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
matching on `Some` with `ok()` is redundant: src/sr/finder/de.rs#L965
warning: matching on `Some` with `ok()` is redundant --> src/sr/finder/de.rs:965:37 | 965 | ... if let Some(v) = TryInto::<Vec<u32>>::try_into(group).ok() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok = note: `#[warn(clippy::match_result_ok)]` on by default help: consider matching on `Ok(v)` and removing the call to `ok` instead | 965 - if let Some(v) = TryInto::<Vec<u32>>::try_into(group).ok() { 965 + if let Ok(v) = TryInto::<Vec<u32>>::try_into(group) { |
called `map(..).flatten()` on `Option`: src/sr/finder/de.rs#L864
warning: called `map(..).flatten()` on `Option` --> src/sr/finder/de.rs:864:22 | 864 | .map(|x| x.group.as_ref()) | ______________________^ 865 | | .flatten() | |______________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|x| x.group.as_ref())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
called `map(..).flatten()` on `Option`: src/sr/finder/de.rs#L834
warning: called `map(..).flatten()` on `Option` --> src/sr/finder/de.rs:834:22 | 834 | .map(|x| x.group.as_ref()) | ______________________^ 835 | | .flatten() | |______________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|x| x.group.as_ref())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
called `map(..).flatten()` on `Option`: src/sr/finder/de.rs#L797
warning: called `map(..).flatten()` on `Option` --> src/sr/finder/de.rs:797:22 | 797 | .map(|x| x.group.as_ref()) | ______________________^ 798 | | .flatten() | |______________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|x| x.group.as_ref())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten = note: `#[warn(clippy::map_flatten)]` on by default
variables can be used directly in the `format!` string: src/sr/finder/de.rs#L730
warning: variables can be used directly in the `format!` string --> src/sr/finder/de.rs:730:65 | 730 | ... return Err(serde::de::Error::custom(format!( | ___________________________________________________________^ 731 | | ... "Unknown Cred field {}", 732 | | ... n 733 | | ... ))); | |_______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: src/sr/finder/de.rs#L603
warning: variables can be used directly in the `format!` string --> src/sr/finder/de.rs:603:17 | 603 | debug!("TaskFinderVisitor: final_path {:?}", final_path); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 603 - debug!("TaskFinderVisitor: final_path {:?}", final_path); 603 + debug!("TaskFinderVisitor: final_path {final_path:?}"); |
useless conversion to the same type: `finder::options::DPathOptions<'_>`: src/sr/finder/de.rs#L557
warning: useless conversion to the same type: `finder::options::DPathOptions<'_>` --> src/sr/finder/de.rs:557:50 | 557 | ... self.spath.union(path.clone().into()); | ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `path.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
variables can be used directly in the `format!` string: src/sr/finder/de.rs#L474
warning: variables can be used directly in the `format!` string --> src/sr/finder/de.rs:474:25 | 474 | debug!("adding task {:?}", task); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 474 - debug!("adding task {:?}", task); 474 + debug!("adding task {task:?}"); |
variables can be used directly in the `format!` string: src/sr/finder/de.rs#L390
warning: variables can be used directly in the `format!` string --> src/sr/finder/de.rs:390:25 | 390 | info!("ActorsSettingsVisitor: Better actor found {:?}", temp); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 390 - info!("ActorsSettingsVisitor: Better actor found {:?}", temp); 390 + info!("ActorsSettingsVisitor: Better actor found {temp:?}"); |
variables can be used directly in the `format!` string: src/sr/finder/de.rs#L387
warning: variables can be used directly in the `format!` string --> src/sr/finder/de.rs:387:21 | 387 | debug!("ActorsSettingsVisitor: actor {:?}", actor); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 387 - debug!("ActorsSettingsVisitor: actor {:?}", actor); 387 + debug!("ActorsSettingsVisitor: actor {actor:?}"); |
variables can be used directly in the `format!` string: src/sr/finder/de.rs#L331
warning: variables can be used directly in the `format!` string --> src/sr/finder/de.rs:331:29 | 331 | ... debug!("RoleFinderVisitor: unknown {}", key); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 331 - debug!("RoleFinderVisitor: unknown {}", key); 331 + debug!("RoleFinderVisitor: unknown {key}"); |
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/de.rs#L326
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/de.rs:326:40 | 326 | ... spath: &mut self.spath, | ^^^^^^^^^^^^^^^ help: change this to: `self.spath` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
useless conversion to the same type: `finder::options::DPathOptions<'_>`: src/sr/finder/de.rs#L309
warning: useless conversion to the same type: `finder::options::DPathOptions<'_>` --> src/sr/finder/de.rs:309:50 | 309 | ... self.spath.union(path.clone().into()); | ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `path.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `#[warn(clippy::useless_conversion)]` on by default
variables can be used directly in the `format!` string: src/sr/finder/de.rs#L71
warning: variables can be used directly in the `format!` string --> src/sr/finder/de.rs:71:36 | 71 | IdTask::Number(num) => write!(f, "{}", num), | ^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 71 - IdTask::Number(num) => write!(f, "{}", num), 71 + IdTask::Number(num) => write!(f, "{num}"), |
variables can be used directly in the `format!` string: src/sr/finder/de.rs#L70
warning: variables can be used directly in the `format!` string --> src/sr/finder/de.rs:70:35 | 70 | IdTask::Name(name) => write!(f, "{}", name), | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 70 - IdTask::Name(name) => write!(f, "{}", name), 70 + IdTask::Name(name) => write!(f, "{name}"), |
variables can be used directly in the `format!` string: src/sr/finder/cmd.rs#L141
warning: variables can be used directly in the `format!` string --> src/sr/finder/cmd.rs:141:13 | 141 | warn!("Error: {}", err); | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 141 - warn!("Error: {}", err); 141 + warn!("Error: {err}"); |
redundant closure: src/sr/finder/cmd.rs#L131
warning: redundant closure --> src/sr/finder/cmd.rs:131:48 | 131 | match shell_words::split(role_cmd).map_err(|e| Into::<Box<dyn std::error::Error>>::into(e)) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Into::<Box<dyn std::error::Error>>::into` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
variables can be used directly in the `format!` string: src/sr/finder/cmd.rs#L115
warning: variables can be used directly in the `format!` string --> src/sr/finder/cmd.rs:115:13 | 115 | debug!("Error: {}", err); | ^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 115 - debug!("Error: {}", err); 115 + debug!("Error: {err}"); |
variables can be used directly in the `format!` string: src/sr/finder/cmd.rs#L104
warning: variables can be used directly in the `format!` string --> src/sr/finder/cmd.rs:104:9 | 104 | debug!("result : {:?}", result); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 104 - debug!("result : {:?}", result); 104 + debug!("result : {result:?}"); |
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/cmd.rs#L98
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/cmd.rs:98:9 | 98 | &cmd_path, | ^^^^^^^^^ help: change this to: `cmd_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/cmd.rs#L68
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/cmd.rs:68:43 | 68 | let regex = RegexBuilder::new().build(&role_args)?; | ^^^^^^^^^^ help: change this to: `role_args` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
variables can be used directly in the `format!` string: src/sr/finder/cmd.rs#L52
warning: variables can be used directly in the `format!` string --> src/sr/finder/cmd.rs:52:13 | 52 | debug!("{:?},No match for args {:?}", e, input_args); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 52 - debug!("{:?},No match for args {:?}", e, input_args); 52 + debug!("{e:?},No match for args {input_args:?}"); |
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/cmd.rs#L28
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/cmd.rs:28:31 | 28 | if min.better(&previous_min) { | ^^^^^^^^^^^^^ help: change this to: `previous_min` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/cmd.rs#L19
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/cmd.rs:19:23 | 19 | if min.better(&previous_min) { | ^^^^^^^^^^^^^ help: change this to: `previous_min` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
unneeded `return` statement: src/sr/finder/cmd.rs#L16
warning: unneeded `return` statement --> src/sr/finder/cmd.rs:16:9 | 16 | return CmdMin::FullWildcardPath; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 16 - return CmdMin::FullWildcardPath; 16 + CmdMin::FullWildcardPath |
use of `or_insert_with` to construct default value: src/sr/finder/api/mod.rs#L115
warning: use of `or_insert_with` to construct default value --> src/sr/finder/api/mod.rs:115:56 | 115 | let callbacks = api.callbacks.entry(event).or_insert_with(Vec::new); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default = note: `#[warn(clippy::unwrap_or_default)]` on by default
very complex type used. Consider factoring parts into `type` definitions: src/sr/finder/api/mod.rs#L26
warning: very complex type used. Consider factoring parts into `type` definitions --> src/sr/finder/api/mod.rs:26:9 | 26 | HashMap<EventKey, Vec<Box<dyn Fn(&mut ApiEvent) -> Result<(), Box<dyn Error>> + Send>>>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity = note: `#[warn(clippy::type_complexity)]` on by default
redundant pattern matching, consider using `is_some()`: src/sr/finder/api/ssd.rs#L54
warning: redundant pattern matching, consider using `is_some()` --> src/sr/finder/api/ssd.rs:54:19 | 54 | } else if let Some(_) = role.role()._extra_values.get("ssd") { | -------^^^^^^^--------------------------------------- help: try: `if role.role()._extra_values.get("ssd").is_some()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching = note: `#[warn(clippy::redundant_pattern_matching)]` on by default
passing a unit value to a function: src/sr/finder/api/hierarchy.rs#L60
warning: passing a unit value to a function --> src/sr/finder/api/hierarchy.rs:60:5 | 60 | / Ok(if let Some(role) = role.config().role(parent) { 61 | | for task in role.tasks() { 62 | | **matching |= settings.task_settings(cli, &task, opt_stack, env_path)?; 63 | | } 64 | | }) | |______^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg = note: `#[warn(clippy::unit_arg)]` on by default help: move the expression in front of the call and replace it with the unit literal `()` | 60 ~ if let Some(role) = role.config().role(parent) { 61 + for task in role.tasks() { 62 + **matching |= settings.task_settings(cli, &task, opt_stack, env_path)?; 63 + } 64 + }; 65 + Ok(()) |
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/api/hierarchy.rs#L41
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/api/hierarchy.rs:41:27 | 41 | .env_path(&env_path) | ^^^^^^^^^ help: change this to: `env_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/api/hierarchy.rs#L29
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/api/hierarchy.rs:29:35 | 29 | .env_path(&env_path) | ^^^^^^^^^ help: change this to: `env_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
variables can be used directly in the `format!` string: src/sr/finder/api/hashchecker.rs#L222
warning: variables can be used directly in the `format!` string --> src/sr/finder/api/hashchecker.rs:222:13 | 222 | warn!("Error: {}", err); | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 222 - warn!("Error: {}", err); 222 + warn!("Error: {err}"); |
redundant closure: src/sr/finder/api/hashchecker.rs#L214
warning: redundant closure --> src/sr/finder/api/hashchecker.rs:214:18 | 214 | .map_err(|e| Into::<Box<dyn std::error::Error>>::into(e)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Into::<Box<dyn std::error::Error>>::into` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure = note: `#[warn(clippy::redundant_closure)]` on by default
variables can be used directly in the `format!` string: src/sr/finder/api/hashchecker.rs#L198
warning: variables can be used directly in the `format!` string --> src/sr/finder/api/hashchecker.rs:198:13 | 198 | debug!("Error: {}", err); | ^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 198 - debug!("Error: {}", err); 198 + debug!("Error: {err}"); |
this expression creates a reference which is immediately dereferenced by the compiler: src/sr/finder/api/hashchecker.rs#L168
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/sr/finder/api/hashchecker.rs:168:31 | 168 | if !evaluate_hash(&hash_element, &buf) { | ^^^^^^^^^^^^^ help: change this to: `hash_element` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
variables can be used directly in the `format!` string: src/sr/finder/api/hashchecker.rs#L165
warning: variables can be used directly in the `format!` string --> src/sr/finder/api/hashchecker.rs:165:17 | 165 | warn!("Error reading file {:?}", res); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `#[warn(clippy::uninlined_format_args)]` on by default help: change this to | 165 - warn!("Error reading file {:?}", res); 165 + warn!("Error reading file {res:?}"); |
unneeded `return` statement: src/sr/finder/api/hashchecker.rs#L117
warning: unneeded `return` statement --> src/sr/finder/api/hashchecker.rs:117:9 | 117 | return CmdMin::FullWildcardPath; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return = note: `#[warn(clippy::needless_return)]` on by default help: remove `return` | 117 - return CmdMin::FullWildcardPath; 117 + CmdMin::FullWildcardPath |
deref which would be done by auto-deref: src/sr/finder/api/hashchecker.rs#L66
warning: deref which would be done by auto-deref --> src/sr/finder/api/hashchecker.rs:66:13 | 66 | *final_path, | ^^^^^^^^^^^ help: try: `final_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
deref which would be done by auto-deref: src/sr/finder/api/hashchecker.rs#L65
warning: deref which would be done by auto-deref --> src/sr/finder/api/hashchecker.rs:65:13 | 65 | *cmd_min, | ^^^^^^^^ help: try: `cmd_min` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref = note: `#[warn(clippy::explicit_auto_deref)]` on by default
variables can be used directly in the `format!` string: src/chsr/cli/mod.rs#L36
warning: variables can be used directly in the `format!` string --> src/chsr/cli/mod.rs:36:5 | 36 | debug!("Inputs : {:?}", inputs); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 36 - debug!("Inputs : {:?}", inputs); 36 + debug!("Inputs : {inputs:?}"); |
variables can be used directly in the `format!` string: src/chsr/cli/usage.rs#L271
warning: variables can be used directly in the `format!` string --> src/chsr/cli/usage.rs:271:5 | 271 | println!("{}", usage); | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 271 - println!("{}", usage); 271 + println!("{usage}"); |
variables can be used directly in the `format!` string: src/chsr/cli/usage.rs#L197
warning: variables can be used directly in the `format!` string --> src/chsr/cli/usage.rs:197:13 | 197 | println!("{:?}", rule); | ^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 197 - println!("{:?}", rule); 197 + println!("{rule:?}"); |
variables can be used directly in the `format!` string: src/chsr/cli/usage.rs#L151
warning: variables can be used directly in the `format!` string --> src/chsr/cli/usage.rs:151:5 | 151 | println!("{}", RAR_USAGE_GENERAL); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 151 - println!("{}", RAR_USAGE_GENERAL); 151 + println!("{RAR_USAGE_GENERAL}"); |
variables can be used directly in the `format!` string: src/chsr/cli/usage.rs#L150
warning: variables can be used directly in the `format!` string --> src/chsr/cli/usage.rs:150:5 | 150 | println!("{}", LONG_ABOUT); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 150 - println!("{}", LONG_ABOUT); 150 + println!("{LONG_ABOUT}"); |
variables can be used directly in the `format!` string: src/chsr/cli/process.rs#L59
warning: variables can be used directly in the `format!` string --> src/chsr/cli/process.rs:59:21 | 59 | debug!("chsr list err {:?}", e); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 59 - debug!("chsr list err {:?}", e); 59 + debug!("chsr list err {e:?}"); |
variables can be used directly in the `format!` string: src/chsr/cli/process/json.rs#L1023
warning: variables can be used directly in the `format!` string --> src/chsr/cli/process/json.rs:1023:21 | 1023 | debug!("options_env_values: {:?}", options_env_values); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 1023 - debug!("options_env_values: {:?}", options_env_values); 1023 + debug!("options_env_values: {options_env_values:?}"); |
variables can be used directly in the `format!` string: src/chsr/cli/process/json.rs#L1019
warning: variables can be used directly in the `format!` string --> src/chsr/cli/process/json.rs:1019:21 | 1019 | debug!("options_env_values: {:?}", options_env_values); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 1019 - debug!("options_env_values: {:?}", options_env_values); 1019 + debug!("options_env_values: {options_env_values:?}"); |
variables can be used directly in the `format!` string: src/chsr/cli/process/json.rs#L1011
warning: variables can be used directly in the `format!` string --> src/chsr/cli/process/json.rs:1011:21 | 1011 | debug!("options_env_values: {:?}", options_env_values); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 1011 - debug!("options_env_values: {:?}", options_env_values); 1011 + debug!("options_env_values: {options_env_values:?}"); |
current MSRV (Minimum Supported Rust Version) is `1.76.0` but this item is stable since `1.83.0`: src/chsr/cli/process/json.rs#L1007
warning: current MSRV (Minimum Supported Rust Version) is `1.76.0` but this item is stable since `1.83.0` --> src/chsr/cli/process/json.rs:1007:26 | 1007 | .get_or_insert_default() | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv = note: `#[warn(clippy::incompatible_msrv)]` on by default
variables can be used directly in the `format!` string: src/chsr/cli/process/json.rs#L1005
warning: variables can be used directly in the `format!` string --> src/chsr/cli/process/json.rs:1005:21 | 1005 | debug!("options_env_values: {:?}", options_env_values); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 1005 - debug!("options_env_values: {:?}", options_env_values); 1005 + debug!("options_env_values: {options_env_values:?}"); |
variables can be used directly in the `format!` string: src/chsr/cli/process/json.rs#L909
warning: variables can be used directly in the `format!` string --> src/chsr/cli/process/json.rs:909:5 | 909 | / debug!( 910 | | "chsr o path {:?} {:?} path1 path2 path3", 911 | | setlist_type, action 912 | | ); | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: src/chsr/cli/process/json.rs#L599
warning: variables can be used directly in the `format!` string --> src/chsr/cli/process/json.rs:599:5 | 599 | debug!("chsr o env set keep-only|delete-only {:?}", options_env); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 599 - debug!("chsr o env set keep-only|delete-only {:?}", options_env); 599 + debug!("chsr o env set keep-only|delete-only {options_env:?}"); |
variables can be used directly in the `format!` string: src/chsr/cli/process/json.rs#L561
warning: variables can be used directly in the `format!` string --> src/chsr/cli/process/json.rs:561:21 | 561 | println!("Command {:?} not in task", cmd); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 561 - println!("Command {:?} not in task", cmd); 561 + println!("Command {cmd:?} not in task"); |
variables can be used directly in the `format!` string: src/chsr/cli/process/json.rs#L541
warning: variables can be used directly in the `format!` string --> src/chsr/cli/process/json.rs:541:21 | 541 | println!("Command {:?} not in task", cmd); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 541 - println!("Command {:?} not in task", cmd); 541 + println!("Command {cmd:?} not in task"); |
variables can be used directly in the `format!` string: src/chsr/cli/process/json.rs#L286
warning: variables can be used directly in the `format!` string --> src/chsr/cli/process/json.rs:286:21 | 286 | println!("Actor {} already in role", a); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 286 - println!("Actor {} already in role", a); 286 + println!("Actor {a} already in role"); |
variables can be used directly in the `format!` string: src/chsr/cli/process/json.rs#L152
warning: variables can be used directly in the `format!` string --> src/chsr/cli/process/json.rs:152:5 | 152 | debug!("chsr role r1 {:?}", action); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 152 - debug!("chsr role r1 {:?}", action); 152 + debug!("chsr role r1 {action:?}"); |
variables can be used directly in the `format!` string: src/chsr/cli/process/json.rs#L53
warning: variables can be used directly in the `format!` string --> src/chsr/cli/process/json.rs:53:17 | 53 | debug!("task {:?}", task); | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 53 - debug!("task {:?}", task); 53 + debug!("task {task:?}"); |
variables can be used directly in the `format!` string: src/chsr/cli/process/convert.rs#L34
warning: variables can be used directly in the `format!` string --> src/chsr/cli/process/convert.rs:34:13 | 34 | debug!("Convert from: {:?}", from); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 34 - debug!("Convert from: {:?}", from); 34 + debug!("Convert from: {from:?}"); |
variables can be used directly in the `format!` string: src/chsr/cli/pair.rs#L398
warning: variables can be used directly in the `format!` string --> src/chsr/cli/pair.rs:398:17 | 398 | debug!("env_key_value: {}={}", key, value); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `#[warn(clippy::uninlined_format_args)]` on by default help: change this to | 398 - debug!("env_key_value: {}={}", key, value); 398 + debug!("env_key_value: {key}={value}"); |
using `map_err` over `inspect_err`: src/chsr/cli/pair.rs#L96
warning: using `map_err` over `inspect_err` --> src/chsr/cli/pair.rs:96:80 | 96 | convertion.from_type = Some(inner.next().unwrap().as_str().parse().map_err(|e| { | ^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect help: try | 96 ~ convertion.from_type = Some(inner.next().unwrap().as_str().parse().inspect_err(|&e| { 97 | warn!( ... 100| StorageMethod::VARIANTS.join(", ") 101~ ); |
using `map_err` over `inspect_err`: src/chsr/cli/pair.rs#L82
warning: using `map_err` over `inspect_err` --> src/chsr/cli/pair.rs:82:73 | 82 | convertion.to_type = inner.next().unwrap().as_str().parse().map_err(|e| { | ^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect = note: `#[warn(clippy::manual_inspect)]` on by default help: try | 82 ~ convertion.to_type = inner.next().unwrap().as_str().parse().inspect_err(|&e| { 83 | warn!( ... 86 | StorageMethod::VARIANTS.join(", ") 87 ~ ); |
variables can be used directly in the `format!` string: rar-common/src/lib.rs#L412
warning: variables can be used directly in the `format!` string --> rar-common/src/lib.rs:412:13 | 412 | debug!("Error reading file: {}", e); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 412 - debug!("Error reading file: {}", e); 412 + debug!("Error reading file: {e}"); |
variables can be used directly in the `format!` string: rar-common/src/lib.rs#L393
warning: variables can be used directly in the `format!` string --> rar-common/src/lib.rs:393:17 | 393 | debug!("Error reading file: {}", e); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 393 - debug!("Error reading file: {}", e); 393 + debug!("Error reading file: {e}"); |
variables can be used directly in the `format!` string: rar-common/src/lib.rs#L388
warning: variables can be used directly in the `format!` string --> rar-common/src/lib.rs:388:17 | 388 | debug!("Error reading file: {}", e); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 388 - debug!("Error reading file: {}", e); 388 + debug!("Error reading file: {e}"); |
variables can be used directly in the `format!` string: rar-common/src/lib.rs#L357
warning: variables can be used directly in the `format!` string --> rar-common/src/lib.rs:357:5 | 357 | debug!("settingsfile: {:?}", settingsfile); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 357 - debug!("settingsfile: {:?}", settingsfile); 357 + debug!("settingsfile: {settingsfile:?}"); |
variables can be used directly in the `format!` string: rar-common/src/lib.rs#L352
warning: variables can be used directly in the `format!` string --> rar-common/src/lib.rs:352:13 | 352 | debug!("Error reading file: {}", e); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 352 - debug!("Error reading file: {}", e); 352 + debug!("Error reading file: {e}"); |
called `Option::take()` on a temporary value: rar-common/src/lib.rs#L296
warning: called `Option::take()` on a temporary value --> rar-common/src/lib.rs:296:22 | 296 | let config = binding.config.as_ref().take().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^------- | | | help: remove | = note: `as_ref` creates a temporary value, so calling take() has no effect = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_option_take = note: `#[warn(clippy::needless_option_take)]` on by default
using `clone` on type `StorageMethod` which implements the `Copy` trait: rar-common/src/lib.rs#L294
warning: using `clone` on type `StorageMethod` which implements the `Copy` trait --> rar-common/src/lib.rs:294:30 | 294 | let storage_method = settings.as_ref().borrow().storage.method.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `settings.as_ref().borrow().storage.method` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[warn(clippy::clone_on_copy)]` on by default
variables can be used directly in the `format!` string: rar-common/src/util.rs#L380
warning: variables can be used directly in the `format!` string --> rar-common/src/util.rs:380:9 | 380 | / debug!( 381 | | "Error creating file without privilege, trying with privileges: {}", 382 | | e 383 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: rar-common/src/util.rs#L367
warning: variables can be used directly in the `format!` string --> rar-common/src/util.rs:367:9 | 367 | / debug!( 368 | | "Error creating file without privilege, trying with privileges: {}", 369 | | e 370 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: rar-common/src/util.rs#L353
warning: variables can be used directly in the `format!` string --> rar-common/src/util.rs:353:9 | 353 | / debug!( 354 | | "Error creating file without privilege, trying with privileges: {}", 355 | | e 356 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: rar-common/src/util.rs#L341
warning: variables can be used directly in the `format!` string --> rar-common/src/util.rs:341:13 | 341 | / debug!( 342 | | "Error creating file without privilege, trying with privileges: {}", 343 | | e 344 | | ); | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: rar-common/src/util.rs#L335
warning: variables can be used directly in the `format!` string --> rar-common/src/util.rs:335:9 | 335 | / debug!( 336 | | "Error creating file without privilege, trying with privileges: {}", 337 | | e 338 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: rar-common/src/util.rs#L216
warning: variables can be used directly in the `format!` string --> rar-common/src/util.rs:216:9 | 216 | / debug!( 217 | | "No match for path ``{:?}`` for evaluated path : ``{:?}``", 218 | | cmd_path, role_path 219 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
this expression creates a reference which is immediately dereferenced by the compiler: rar-common/src/util.rs#L211
warning: this expression creates a reference which is immediately dereferenced by the compiler --> rar-common/src/util.rs:211:33 | 211 | if pattern.matches_path(&cmd_path) { | ^^^^^^^^^ help: change this to: `cmd_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
variables can be used directly in the `format!` string: rar-common/src/util.rs#L207
warning: variables can be used directly in the `format!` string --> rar-common/src/util.rs:207:5 | 207 | debug!("Matching path {:?} with {:?}", cmd_path, role_path); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 207 - debug!("Matching path {:?} with {:?}", cmd_path, role_path); 207 + debug!("Matching path {cmd_path:?} with {role_path:?}"); |
variables can be used directly in the `format!` string: rar-common/src/util.rs#L193
warning: variables can be used directly in the `format!` string --> rar-common/src/util.rs:193:13 | 193 | debug!("Checking path: {:?}", full_path); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 193 - debug!("Checking path: {:?}", full_path); 193 + debug!("Checking path: {full_path:?}"); |
writing `&String` instead of `&str` involves a new object where a slice will do: rar-common/src/database/mod.rs#L123
warning: writing `&String` instead of `&str` involves a new object where a slice will do --> rar-common/src/database/mod.rs:123:34 | 123 | fn convert_string_to_duration(s: &String) -> Result<Option<chrono::TimeDelta>, Box<dyn Error>> { | ^^^^^^^ help: change this to: `&str` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg = note: `#[warn(clippy::ptr_arg)]` on by default
variables can be used directly in the `format!` string: rar-common/src/database/structs.rs#L507
warning: variables can be used directly in the `format!` string --> rar-common/src/database/structs.rs:507:28 | 507 | .ok_or_else(|| format!("Task {} not found in role {}", name, role).into()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 507 - .ok_or_else(|| format!("Task {} not found in role {}", name, role).into()) 507 + .ok_or_else(|| format!("Task {name} not found in role {role}").into()) |
variables can be used directly in the `format!` string: rar-common/src/database/structs.rs#L93
warning: variables can be used directly in the `format!` string --> rar-common/src/database/structs.rs:93:35 | 93 | IdTask::Number(id) => write!(f, "{}", id), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 93 - IdTask::Number(id) => write!(f, "{}", id), 93 + IdTask::Number(id) => write!(f, "{id}"), |
variables can be used directly in the `format!` string: rar-common/src/database/structs.rs#L92
warning: variables can be used directly in the `format!` string --> rar-common/src/database/structs.rs:92:35 | 92 | IdTask::Name(name) => write!(f, "{}", name), | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 92 - IdTask::Name(name) => write!(f, "{}", name), 92 + IdTask::Name(name) => write!(f, "{name}"), |
this `else { if .. }` block can be collapsed: rar-common/src/database/ser.rs#L183
warning: this `else { if .. }` block can be collapsed --> rar-common/src/database/ser.rs:183:16 | 183 | } else { | ________________^ 184 | | if serializer.is_human_readable() { 185 | | let mut map = serializer.serialize_map(Some(3))?; 186 | | if self.default_behavior.is_all() { ... | 213 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if = note: `#[warn(clippy::collapsible_else_if)]` on by default help: collapse nested if block | 183 ~ } else if serializer.is_human_readable() { 184 + let mut map = serializer.serialize_map(Some(3))?; 185 + if self.default_behavior.is_all() { 186 + map.serialize_entry("default", &self.default_behavior)?; 187 + } 188 + if !self.add.is_empty() { 189 + let v: Vec<String> = self.add.iter().map(|cap| cap.to_string()).collect(); 190 + map.serialize_entry("add", &v)?; 191 + } 192 + if !self.sub.is_empty() { 193 + let v: Vec<String> = self.sub.iter().map(|cap| cap.to_string()).collect(); 194 + map.serialize_entry("del", &v)?; 195 + } 196 + map.end() 197 + } else { 198 + let mut map = serializer.serialize_map(Some(3))?; 199 + if self.default_behavior.is_all() { 200 + map.serialize_entry("d", &(self.default_behavior as u8))?; 201 + } 202 + if !self.add.is_empty() { 203 + let v: Vec<String> = self.add.iter().map(|cap| cap.to_string()).collect(); 204 + map.serialize_entry("a", &v)?; 205 + } 206 + if !self.sub.is_empty() { 207 + let v: Vec<String> = self.sub.iter().map(|cap| cap.to_string()).collect(); 208 + map.serialize_entry("s", &v)?; 209 + } 210 + map.end() 211 + } |
unneeded `return` statement: rar-common/src/database/ser.rs#L90
warning: unneeded `return` statement --> rar-common/src/database/ser.rs:90:13 | 90 | return serializer.serialize_u8(*self as u8); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 90 - return serializer.serialize_u8(*self as u8); 90 + serializer.serialize_u8(*self as u8) |
unneeded `return` statement: rar-common/src/database/ser.rs#L88
warning: unneeded `return` statement --> rar-common/src/database/ser.rs:88:13 | 88 | return serializer.serialize_str(&self.to_string()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 88 - return serializer.serialize_str(&self.to_string()); 88 + serializer.serialize_str(&self.to_string()) |
variables can be used directly in the `format!` string: rar-common/src/database/options.rs#L848
warning: variables can be used directly in the `format!` string --> rar-common/src/database/options.rs:848:25 | 848 | debug!("check: {:?}", final_check); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 848 - debug!("check: {:?}", final_check); 848 + debug!("check: {final_check:?}"); |
variables can be used directly in the `format!` string: rar-common/src/database/options.rs#L829
warning: variables can be used directly in the `format!` string --> rar-common/src/database/options.rs:829:25 | 829 | debug!("check: {:?}", final_check); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 829 - debug!("check: {:?}", final_check); 829 + debug!("check: {final_check:?}"); |
this `map_or` can be simplified: rar-common/src/database/options.rs#L483
warning: this `map_or` can be simplified --> rar-common/src/database/options.rs:483:9 | 483 | self.as_ref().map_or(false, |set| set.env_matches(needle)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or help: use is_some_and instead | 483 - self.as_ref().map_or(false, |set| set.env_matches(needle)) 483 + self.as_ref().is_some_and(|set| set.env_matches(needle)) |
variables can be used directly in the `format!` string: rar-common/src/database/options.rs#L426
warning: variables can be used directly in the `format!` string --> rar-common/src/database/options.rs:426:17 | 426 | Err(format!( | _________________^ 427 | | "env key {}, must be a valid env, or a valid regex", 428 | | s 429 | | )) | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: rar-common/src/database/options.rs#L404
warning: variables can be used directly in the `format!` string --> rar-common/src/database/options.rs:404:17 | 404 | Regex::new(&format!("^{}$", s)).is_ok() | ^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 404 - Regex::new(&format!("^{}$", s)).is_ok() 404 + Regex::new(&format!("^{s}$")).is_ok() |
variables can be used directly in the `format!` string: rar-common/src/database/migration.rs#L117
warning: variables can be used directly in the `format!` string --> rar-common/src/database/migration.rs:117:32 | 117 | return Err(format!("No migration from {} to {} found", from, to).into()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 117 - return Err(format!("No migration from {} to {} found", from, to).into()); 117 + return Err(format!("No migration from {from} to {to} found").into()); |
variables can be used directly in the `format!` string: rar-common/src/database/migration.rs#L89
warning: variables can be used directly in the `format!` string --> rar-common/src/database/migration.rs:89:9 | 89 | debug!("===== Migrating from {} to {} =====", from, to); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 89 - debug!("===== Migrating from {} to {} =====", from, to); 89 + debug!("===== Migrating from {from} to {to} ====="); |
variables can be used directly in the `format!` string: rar-common/src/database/de.rs#L188
warning: variables can be used directly in the `format!` string --> rar-common/src/database/de.rs:188:55 | 188 | ... de::Error::custom(format!("Invalid capability: {}", value)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 188 - de::Error::custom(format!("Invalid capability: {}", value)) 188 + de::Error::custom(format!("Invalid capability: {value}")) |
variables can be used directly in the `format!` string: rar-common/src/database/de.rs#L179
warning: variables can be used directly in the `format!` string --> rar-common/src/database/de.rs:179:55 | 179 | ... de::Error::custom(format!("Invalid capability: {}", value)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 179 - de::Error::custom(format!("Invalid capability: {}", value)) 179 + de::Error::custom(format!("Invalid capability: {value}")) |
variables can be used directly in the `format!` string: rar-common/src/database/de.rs#L101
warning: variables can be used directly in the `format!` string --> rar-common/src/database/de.rs:101:50 | 101 | return Err(de::Error::custom(format!( | __________________________________________________^ 102 | | "Invalid value for SetBehavior: {}", 103 | | v 104 | | ))); | |_____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: rar-common/src/database/de.rs#L77
warning: variables can be used directly in the `format!` string --> rar-common/src/database/de.rs:77:50 | 77 | return Err(de::Error::custom(format!( | __________________________________________________^ 78 | | "Invalid value for SetBehavior: {}", 79 | | v 80 | | ))); | |_____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: rar-common/src/database/de.rs#L49
warning: variables can be used directly in the `format!` string --> rar-common/src/database/de.rs:49:73 | 49 | SetBehavior::from_repr(v as u8).ok_or(de::Error::custom(format!( | _________________________________________________________________________^ 50 | | "Invalid value for SetBehavior: {}", 51 | | v 52 | | ))) | |_________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
variables can be used directly in the `format!` string: rar-common/src/database/de.rs#L44
warning: variables can be used directly in the `format!` string --> rar-common/src/database/de.rs:44:50 | 44 | return Err(de::Error::custom(format!( | __________________________________________________^ 45 | | "Invalid value for SetBehavior: {}", 46 | | v 47 | | ))); | |_____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
manual `!RangeInclusive::contains` implementation: rar-common/src/database/de.rs#L43
warning: manual `!RangeInclusive::contains` implementation --> rar-common/src/database/de.rs:43:20 | 43 | if v > 1 || v < 0 { | ^^^^^^^^^^^^^^ help: use: `!(0..=1).contains(&v)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains = note: `#[warn(clippy::manual_range_contains)]` on by default
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L710
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:710:17 | 710 | write!(f, "Unknown: {}", unknown) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 710 - write!(f, "Unknown: {}", unknown) 710 + write!(f, "Unknown: {unknown}") |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L544
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:544:36 | 544 | ... .ok_or(format!("{} group does not exist", group))?, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 544 - .ok_or(format!("{} group does not exist", group))?, 544 + .ok_or(format!("{group} group does not exist"))?, |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L537
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:537:24 | 537 | .ok_or(format!("{} group does not exist", group))?]), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 537 - .ok_or(format!("{} group does not exist", group))?]), 537 + .ok_or(format!("{group} group does not exist"))?]), |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L521
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:521:36 | 521 | ... .ok_or(format!("{} group does not exist", group))?, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 521 - .ok_or(format!("{} group does not exist", group))?, 521 + .ok_or(format!("{group} group does not exist"))?, |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L514
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:514:24 | 514 | .ok_or(format!("{} group does not exist", group))?]), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 514 - .ok_or(format!("{} group does not exist", group))?]), 514 + .ok_or(format!("{group} group does not exist"))?]), |
unneeded `return` statement: rar-common/src/database/actor.rs#L296
warning: unneeded `return` statement --> rar-common/src/database/actor.rs:296:21 | 296 | / return Ok(SGroups::Single(SGroupType(SGenericActorType::Name( 297 | | v.to_string(), 298 | | )))); | |________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 296 ~ Ok(SGroups::Single(SGroupType(SGenericActorType::Name( 297 + v.to_string(), 298 ~ )))) |
unneeded `return` statement: rar-common/src/database/actor.rs#L294
warning: unneeded `return` statement --> rar-common/src/database/actor.rs:294:21 | 294 | return Ok(SGroups::Single(SGroupType(SGenericActorType::Id(group)))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 294 - return Ok(SGroups::Single(SGroupType(SGenericActorType::Id(group)))); 294 + Ok(SGroups::Single(SGroupType(SGenericActorType::Id(group)))) |
this lifetime isn't used in the impl: rar-common/src/database/actor.rs#L282
warning: this lifetime isn't used in the impl --> rar-common/src/database/actor.rs:282:23 | 282 | impl<'de: 'a, 'a> serde::de::Visitor<'de> for SGroupsVisitor { | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
this lifetime isn't used in the impl: rar-common/src/database/actor.rs#L276
warning: this lifetime isn't used in the impl --> rar-common/src/database/actor.rs:276:15 | 276 | impl<'de: 'a, 'a> Deserialize<'de> for SGroups { | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default
unneeded `return` statement: rar-common/src/database/actor.rs#L237
warning: unneeded `return` statement --> rar-common/src/database/actor.rs:237:21 | 237 | / return Ok(DGroups::Single(DGroupType(DGenericActorType::Name( 238 | | Cow::Borrowed(v), 239 | | )))); | |________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 237 ~ Ok(DGroups::Single(DGroupType(DGenericActorType::Name( 238 + Cow::Borrowed(v), 239 ~ )))) |
unneeded `return` statement: rar-common/src/database/actor.rs#L235
warning: unneeded `return` statement --> rar-common/src/database/actor.rs:235:21 | 235 | return Ok(DGroups::Single(DGroupType(DGenericActorType::Id(group)))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return = note: `#[warn(clippy::needless_return)]` on by default help: remove `return` | 235 - return Ok(DGroups::Single(DGroupType(DGenericActorType::Id(group)))); 235 + Ok(DGroups::Single(DGroupType(DGenericActorType::Id(group)))) |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L168
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:168:17 | 168 | write!(f, "[{}]", result) | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 168 - write!(f, "[{}]", result) 168 + write!(f, "[{result}]") |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L164
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:164:38 | 164 | result.push_str(&format!("{}, ", group)); | ^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 164 - result.push_str(&format!("{}, ", group)); 164 + result.push_str(&format!("{group}, ")); |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L160
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:160:39 | 160 | SGroups::Single(group) => write!(f, "[{}]", group), | ^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 160 - SGroups::Single(group) => write!(f, "[{}]", group), 160 + SGroups::Single(group) => write!(f, "[{group}]"), |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L145
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:145:46 | 145 | DGenericActorType::Name(name) => write!(f, "{}", name), | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 145 - DGenericActorType::Name(name) => write!(f, "{}", name), 145 + DGenericActorType::Name(name) => write!(f, "{name}"), |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L144
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:144:42 | 144 | DGenericActorType::Id(id) => write!(f, "{}", id), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 144 - DGenericActorType::Id(id) => write!(f, "{}", id), 144 + DGenericActorType::Id(id) => write!(f, "{id}"), |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L137
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:137:46 | 137 | DGenericActorType::Name(name) => write!(f, "{}", name), | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 137 - DGenericActorType::Name(name) => write!(f, "{}", name), 137 + DGenericActorType::Name(name) => write!(f, "{name}"), |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L136
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:136:42 | 136 | DGenericActorType::Id(id) => write!(f, "{}", id), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 136 - DGenericActorType::Id(id) => write!(f, "{}", id), 136 + DGenericActorType::Id(id) => write!(f, "{id}"), |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L90
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:90:46 | 90 | SGenericActorType::Name(name) => write!(f, "{}", name), | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 90 - SGenericActorType::Name(name) => write!(f, "{}", name), 90 + SGenericActorType::Name(name) => write!(f, "{name}"), |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L89
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:89:42 | 89 | SGenericActorType::Id(id) => write!(f, "{}", id), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 89 - SGenericActorType::Id(id) => write!(f, "{}", id), 89 + SGenericActorType::Id(id) => write!(f, "{id}"), |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L75
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:75:46 | 75 | SGenericActorType::Name(name) => write!(f, "{}", name), | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 75 - SGenericActorType::Name(name) => write!(f, "{}", name), 75 + SGenericActorType::Name(name) => write!(f, "{name}"), |
variables can be used directly in the `format!` string: rar-common/src/database/actor.rs#L74
warning: variables can be used directly in the `format!` string --> rar-common/src/database/actor.rs:74:42 | 74 | SGenericActorType::Id(id) => write!(f, "{}", id), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `#[warn(clippy::uninlined_format_args)]` on by default help: change this to | 74 - SGenericActorType::Id(id) => write!(f, "{}", id), 74 + SGenericActorType::Id(id) => write!(f, "{id}"), |
this `map_or` can be simplified: rar-common/src/database/score.rs#L293
warning: this `map_or` can be simplified --> rar-common/src/database/score.rs:293:5 | 293 | (*actortype).fetch_id().map_or(false, |id| id == 0) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or help: use a standard comparison instead | 293 - (*actortype).fetch_id().map_or(false, |id| id == 0) 293 + (*actortype).fetch_id() == Some(0) |
this `map_or` can be simplified: rar-common/src/database/score.rs#L290
warning: this `map_or` can be simplified --> rar-common/src/database/score.rs:290:5 | 290 | (*actortype).fetch_id().map_or(false, |id| id == 0) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or help: use a standard comparison instead | 290 - (*actortype).fetch_id().map_or(false, |id| id == 0) 290 + (*actortype).fetch_id() == Some(0) |
this `map_or` can be simplified: rar-common/src/database/score.rs#L286
warning: this `map_or` can be simplified --> rar-common/src/database/score.rs:286:5 | 286 | (*actortype).fetch_id().map_or(false, |id| id == 0) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or help: use a standard comparison instead | 286 - (*actortype).fetch_id().map_or(false, |id| id == 0) 286 + (*actortype).fetch_id() == Some(0) |
this `map_or` can be simplified: rar-common/src/database/score.rs#L283
warning: this `map_or` can be simplified --> rar-common/src/database/score.rs:283:5 | 283 | (*actortype).fetch_id().map_or(false, |id| id == 0) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or = note: `#[warn(clippy::unnecessary_map_or)]` on by default help: use a standard comparison instead | 283 - (*actortype).fetch_id().map_or(false, |id| id == 0) 283 + (*actortype).fetch_id() == Some(0) |
using `contains()` instead of `iter().any()` is more efficient: rar-common/src/database/score.rs#L92
warning: using `contains()` instead of `iter().any()` is more efficient --> rar-common/src/database/score.rs:92:22 | 92 | is_root: s.iter().any(|id| *id == 0), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `s.contains(&0)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains = note: `#[warn(clippy::manual_contains)]` on by default
this expression creates a reference which is immediately dereferenced by the compiler: rar-common/src/database/score.rs#L83
warning: this expression creates a reference which is immediately dereferenced by the compiler --> rar-common/src/database/score.rs:83:37 | 83 | is_root: dgroup_is_root(&s), | ^^ help: change this to: `s` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: rar-common/src/database/score.rs#L75
warning: this expression creates a reference which is immediately dereferenced by the compiler --> rar-common/src/database/score.rs:75:41 | 75 | nb_groups: dgroups_len(Some(&s)), | ^^ help: change this to: `s` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
variables can be used directly in the `format!` string: build.rs#L78
warning: variables can be used directly in the `format!` string --> build.rs:78:9 | 78 | eprintln!("cargo:warning={}", err); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 78 - eprintln!("cargo:warning={}", err); 78 + eprintln!("cargo:warning={err}"); |
variables can be used directly in the `format!` string: build.rs#L74
warning: variables can be used directly in the `format!` string --> build.rs:74:9 | 74 | eprintln!("cargo:warning={}", err); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 74 - eprintln!("cargo:warning={}", err); 74 + eprintln!("cargo:warning={err}"); |
variables can be used directly in the `format!` string: build.rs#L70
warning: variables can be used directly in the `format!` string --> build.rs:70:9 | 70 | eprintln!("cargo:warning={}", err); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 70 - eprintln!("cargo:warning={}", err); 70 + eprintln!("cargo:warning={err}"); |
variables can be used directly in the `format!` string: build.rs#L49
warning: variables can be used directly in the `format!` string --> build.rs:49:13 | 49 | writeln!(readme, "{}", line)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 49 - writeln!(readme, "{}", line)?; 49 + writeln!(readme, "{line}")?; |
variables can be used directly in the `format!` string: build.rs#L47
warning: variables can be used directly in the `format!` string --> build.rs:47:13 | 47 | writeln!(readme, "{}", s)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 47 - writeln!(readme, "{}", s)?; 47 + writeln!(readme, "{s}")?; |
variables can be used directly in the `format!` string: build.rs#L46
warning: variables can be used directly in the `format!` string --> build.rs:46:25 | 46 | s.push_str(&format!("(V{}){}", package_version, end)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 46 - s.push_str(&format!("(V{}){}", package_version, end)); 46 + s.push_str(&format!("(V{package_version}){end}")); |
variables can be used directly in the `format!` string: build.rs#L30
warning: variables can be used directly in the `format!` string --> build.rs:30:13 | 30 | writeln!(cargo_toml, "{}", line)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 30 - writeln!(cargo_toml, "{}", line)?; 30 + writeln!(cargo_toml, "{line}")?; |
variables can be used directly in the `format!` string: build.rs#L28
warning: variables can be used directly in the `format!` string --> build.rs:28:13 | 28 | ... writeln!(cargo_toml, "rar-common = {{ path = \"rar-common\", version = \"{}\", package = \"rootasrole-core\" }}", package_version)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 28 - writeln!(cargo_toml, "rar-common = {{ path = \"rar-common\", version = \"{}\", package = \"rootasrole-core\" }}", package_version)?; 28 + writeln!(cargo_toml, "rar-common = {{ path = \"rar-common\", version = \"{package_version}\", package = \"rootasrole-core\" }}")?; |
variables can be used directly in the `format!` string: build.rs#L26
warning: variables can be used directly in the `format!` string --> build.rs:26:13 | 26 | writeln!(cargo_toml, "version = \"{}\"", package_version)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `#[warn(clippy::uninlined_format_args)]` on by default help: change this to | 26 - writeln!(cargo_toml, "version = \"{}\"", package_version)?; 26 + writeln!(cargo_toml, "version = \"{package_version}\"")?; |
Rust Quality Gate
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Rust Quality Gate
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Rust Quality Gate
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Rust Quality Gate
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/