Skip to content

cargo fmt

cargo fmt #198

GitHub Actions / clippy succeeded Sep 10, 2024 in 1s

clippy

52 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 52
Note 0
Help 0

Versions

  • rustc 1.81.0 (eeb90cda1 2024-09-04)
  • cargo 1.81.0 (2dbb1af80 2024-08-20)
  • clippy 0.1.81 (eeb90cd 2024-09-04)

Annotations

Check warning on line 888 in src/chsr/cli/process/json.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field assignment outside of initializer for an instance created with Default::default()

warning: field assignment outside of initializer for an instance created with Default::default()
   --> src/chsr/cli/process/json.rs:888:13
    |
888 |             path.default_behavior = options_path_policy;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: consider initializing the variable with `rar_common::database::options::SPathOptions { default_behavior: options_path_policy, ..Default::default() }` and removing relevant reassignments
   --> src/chsr/cli/process/json.rs:887:13
    |
887 |             let mut path = SPathOptions::default();
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

Check warning on line 610 in src/chsr/cli/process/json.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field assignment outside of initializer for an instance created with Default::default()

warning: field assignment outside of initializer for an instance created with Default::default()
   --> src/chsr/cli/process/json.rs:610:9
    |
610 |         env.default_behavior = options_env_policy;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: consider initializing the variable with `rar_common::database::options::SEnvOptions { default_behavior: options_env_policy, ..Default::default() }` and removing relevant reassignments
   --> src/chsr/cli/process/json.rs:609:9
    |
609 |         let mut env = SEnvOptions::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
    = note: `#[warn(clippy::field_reassign_with_default)]` on by default

Check warning on line 22 in src/chsr/cli/pair.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
  --> src/chsr/cli/pair.rs:22:18
   |
22 |     do_matching: &dyn Fn(&Pair<Rule>, &mut Inputs) -> Result<(), Box<dyn Error>>,
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = 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

Check warning on line 51 in src/chsr/cli/data.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

all variants have the same postfix: `List`

warning: all variants have the same postfix: `List`
  --> src/chsr/cli/data.rs:46:1
   |
46 | / pub enum SetListType {
47 | |     WhiteList,
48 | |     BlackList,
49 | |     CheckList,
50 | |     SetList,
51 | | }
   | |_^
   |
   = help: remove the postfixes and use full paths to the variants instead of glob imports
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
   = note: `#[warn(clippy::enum_variant_names)]` on by default

Check warning on line 409 in src/sr/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary `if let` since only the `Some` variant of the iterator element is used

warning: unnecessary `if let` since only the `Some` variant of the iterator element is used
   --> src/sr/main.rs:405:13
    |
405 |               for group in res {
    |               ^            --- help: try: `res.flatten()`
    |  _____________|
    | |
406 | |                 if let Some(group) = group {
407 | |                     groups.push(group.gid.as_raw());
408 | |                 }
409 | |             }
    | |_____________^
    |
help: ...and remove the `if let` statement in the for loop
   --> src/sr/main.rs:406:17
    |
406 | /                 if let Some(group) = group {
407 | |                     groups.push(group.gid.as_raw());
408 | |                 }
    | |_________________^
    = 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

Check warning on line 329 in src/sr/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

returning the result of a `let` binding from a block

warning: returning the result of a `let` binding from a block
   --> src/sr/main.rs:329:5
    |
323 | /     let user = Cred {
324 | |         user,
325 | |         groups,
326 | |         tty,
327 | |         ppid,
328 | |     };
    | |______- unnecessary `let` binding
329 |       user
    |       ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
    = note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
    |
323 ~     
324 ~     Cred {
325 +         user,
326 +         groups,
327 +         tty,
328 +         ppid,
329 +     }
    |

Check warning on line 284 in src/sr/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`to_string` applied to a type that implements `Display` in `eprintln!` args

warning: `to_string` applied to a type that implements `Display` in `eprintln!` args
   --> src/sr/main.rs:284:68
    |
284 |             eprintln!("sr: {} : {}", execcfg.exec_path.display(), e.to_string());
    |                                                                    ^^^^^^^^^^^^ help: remove this
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
    = note: `#[warn(clippy::to_string_in_format_args)]` on by default

Check warning on line 221 in src/sr/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`

warning: current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`
   --> src/sr/main.rs:219:14
    |
219 |               .inspect_err(|e| {
    |  ______________^
220 | |                 error!("{}", e);
221 | |             })
    | |______________^
    |
    = 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

Check warning on line 182 in src/sr/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this loop could be written as a `for` loop

warning: this loop could be written as a `for` loop
   --> src/sr/main.rs:182:5
    |
182 |     while let Some(arg) = iter.next() {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for arg in iter`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator
    = note: `#[warn(clippy::while_let_on_iterator)]` on by default

Check warning on line 184 in src/sr/timeout.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/sr/timeout.rs:184:15
    |
184 |         .join(&user.user.uid.as_raw().to_string())
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `user.user.uid.as_raw().to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 181 in src/sr/timeout.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/sr/timeout.rs:181:44
    |
181 |     let path = Path::new(TS_LOCATION).join(&user.user.uid.as_raw().to_string());
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `user.user.uid.as_raw().to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 164 in src/sr/timeout.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/sr/timeout.rs:164:44
    |
164 |     let path = Path::new(TS_LOCATION).join(&user.user.uid.as_raw().to_string());
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `user.user.uid.as_raw().to_string()`
    |
    = 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

Check warning on line 40 in src/sr/timeout.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

name `PPID` contains a capitalized acronym

warning: name `PPID` contains a capitalized acronym
  --> src/sr/timeout.rs:40:5
   |
40 |     PPID(pid_t),
   |     ^^^^ help: consider making the acronym lowercase, except the initial letter: `Ppid`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

Check warning on line 39 in src/sr/timeout.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

name `TTY` contains a capitalized acronym

warning: name `TTY` contains a capitalized acronym
  --> src/sr/timeout.rs:39:5
   |
39 |     TTY(dev_t),
   |     ^^^ help: consider making the acronym lowercase, except the initial letter: `Tty`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
   = note: `#[warn(clippy::upper_case_acronyms)]` on by default

Check warning on line 29 in src/sr/pam/securemem.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `leak` is never used

warning: method `leak` is never used
  --> src/sr/pam/securemem.rs:29:12
   |
26 | impl PamBuffer {
   | -------------- method in this implementation
...
29 |     pub fn leak(self) -> NonNull<u8> {
   |            ^^^^

Check warning on line 27 in src/sr/pam/cutils.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

function `errno_location` is never used

warning: function `errno_location` is never used
  --> src/sr/pam/cutils.rs:27:8
   |
27 |     fn errno_location() -> *mut libc::c_int;
   |        ^^^^^^^^^^^^^^

Check warning on line 72 in src/sr/pam/cutils.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

function `safe_isatty` is never used

warning: function `safe_isatty` is never used
  --> src/sr/pam/cutils.rs:72:8
   |
72 | pub fn safe_isatty(fildes: libc::c_int) -> bool {
   |        ^^^^^^^^^^^

Check warning on line 60 in src/sr/pam/cutils.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

function `os_string_from_ptr` is never used

warning: function `os_string_from_ptr` is never used
  --> src/sr/pam/cutils.rs:60:15
   |
60 | pub unsafe fn os_string_from_ptr(ptr: *const libc::c_char) -> OsString {
   |               ^^^^^^^^^^^^^^^^^^

Check warning on line 46 in src/sr/pam/cutils.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

function `string_from_ptr` is never used

warning: function `string_from_ptr` is never used
  --> src/sr/pam/cutils.rs:46:15
   |
46 | pub unsafe fn string_from_ptr(ptr: *const libc::c_char) -> String {
   |               ^^^^^^^^^^^^^^^

Check warning on line 34 in src/sr/pam/cutils.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

function `sysconf` is never used

warning: function `sysconf` is never used
  --> src/sr/pam/cutils.rs:34:8
   |
34 | pub fn sysconf(name: libc::c_int) -> Option<libc::c_long> {
   |        ^^^^^^^

Check warning on line 30 in src/sr/pam/cutils.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

function `set_errno` is never used

warning: function `set_errno` is never used
  --> src/sr/pam/cutils.rs:30:8
   |
30 | pub fn set_errno(no: libc::c_int) {
   |        ^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

Check warning on line 19 in src/chsr/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition name: `tarpaulin_include`

warning: unexpected `cfg` condition name: `tarpaulin_include`
  --> src/chsr/main.rs:19:11
   |
19 | #[cfg(not(tarpaulin_include))]
   |           ^^^^^^^^^^^^^^^^^
   |
   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }
   = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(tarpaulin_include)");` to the top of the `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default

Check warning on line 188 in src/sr/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition name: `tarpaulin_include`

warning: unexpected `cfg` condition name: `tarpaulin_include`
   --> src/sr/main.rs:188:11
    |
188 | #[cfg(not(tarpaulin_include))]
    |           ^^^^^^^^^^^^^^^^^
    |
    = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
             unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }
    = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(tarpaulin_include)");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default

Check warning on line 86 in rar-common/src/util.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

passing a unit value to a function

warning: passing a unit value to a function
  --> rar-common/src/util.rs:79:5
   |
79 | /     Ok(match effective {
80 | |         false => {
81 | |             read_effective(false).and(dac_override_effective(false))?;
82 | |         }
...  |
85 | |         }
86 | |     })
   | |______^
   |
   = 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 `()`
   |
79 ~     match effective {
80 +         false => {
81 +             read_effective(false).and(dac_override_effective(false))?;
82 +         }
83 +         true => {
84 +             read_effective(true).or(dac_override_effective(true))?;
85 +         }
86 +     };
87 +     Ok(())
   |

Check warning on line 409 in rar-common/src/database/structs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field assignment outside of initializer for an instance created with Default::default()

warning: field assignment outside of initializer for an instance created with Default::default()
   --> rar-common/src/database/structs.rs:409:9
    |
409 |         ret.name = name;
    |         ^^^^^^^^^^^^^^^^
    |
note: consider initializing the variable with `database::structs::STask { name: name, _role: Some(role), ..Default::default() }` and removing relevant reassignments
   --> rar-common/src/database/structs.rs:408:9
    |
408 |         let mut ret = STask::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default