Skip to content

Capable: Add json output #144

Capable: Add json output

Capable: Add json output #144

GitHub Actions / clippy succeeded May 14, 2024 in 2s

clippy

114 warnings

Details

Results

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

Versions

  • rustc 1.78.0 (9b00956e5 2024-04-29)
  • cargo 1.78.0 (54d8815d0 2024-03-26)
  • clippy 0.1.78 (9b00956 2024-04-29)

Annotations

Check warning on line 133 in src/chsr/../util.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

single-character string constant used as pattern

warning: single-character string constant used as pattern
   --> src/chsr/../util.rs:133:45
    |
133 |                 format!("\"{}\"", s.replace("\"", "\\\""))
    |                                             ^^^^ help: consider using a `char`: `'"'`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
    = note: `#[warn(clippy::single_char_pattern)]` on by default

Check warning on line 555 in src/chsr/../database/structs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

methods called `into_*` usually take `self` by value

warning: methods called `into_*` usually take `self` by value
   --> src/chsr/../database/structs.rs:555:22
    |
555 |     pub fn into_user(&self) -> Result<Option<User>, Errno> {
    |                      ^^^^^
    |
    = help: consider choosing a less ambiguous name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention

Check warning on line 549 in src/chsr/../database/structs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

methods called `into_*` usually take `self` by value

warning: methods called `into_*` usually take `self` by value
   --> src/chsr/../database/structs.rs:549:23
    |
549 |     pub fn into_group(&self) -> Result<Option<Group>, Errno> {
    |                       ^^^^^
    |
    = help: consider choosing a less ambiguous name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
    = note: `#[warn(clippy::wrong_self_convention)]` on by default

Check warning on line 392 in src/chsr/../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()
   --> src/chsr/../database/structs.rs:392:9
    |
392 |         ret.name = name;
    |         ^^^^^^^^^^^^^^^^
    |
note: consider initializing the variable with `common::database::structs::STask { name: name, _role: Some(role), ..Default::default() }` and removing relevant reassignments
   --> src/chsr/../database/structs.rs:391:9
    |
391 |         let mut ret = STask::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

Check warning on line 375 in src/chsr/../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()
   --> src/chsr/../database/structs.rs:375:9
    |
375 |         ret.name = name;
    |         ^^^^^^^^^^^^^^^^
    |
note: consider initializing the variable with `common::database::structs::SRole { name: name, _config: Some(config), ..Default::default() }` and removing relevant reassignments
   --> src/chsr/../database/structs.rs:374:9
    |
374 |         let mut ret = SRole::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

Check warning on line 310 in src/chsr/../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()
   --> src/chsr/../database/structs.rs:310:9
    |
310 |         c.add = capset;
    |         ^^^^^^^^^^^^^^^
    |
note: consider initializing the variable with `common::database::structs::SCapabilities { add: capset, ..Default::default() }` and removing relevant reassignments
   --> src/chsr/../database/structs.rs:309:9
    |
309 |         let mut c = SCapabilities::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

Check warning on line 684 in src/chsr/../database/options.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/../database/options.rs:680:10
    |
680 |       ) -> (
    |  __________^
681 | |         PathBehavior,
682 | |         Rc<RefCell<LinkedHashSet<String>>>,
683 | |         Rc<RefCell<LinkedHashSet<String>>>,
684 | |     ) {
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 629 in src/chsr/../database/options.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/../database/options.rs:625:10
    |
625 |       ) -> (
    |  __________^
626 | |         PathBehavior,
627 | |         Rc<RefCell<LinkedHashSet<String>>>,
628 | |         Rc<RefCell<LinkedHashSet<String>>>,
629 | |     ) {
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 537 in src/chsr/../database/options.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/../database/options.rs:537:9
    |
537 |         opt.level = Level::Global;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: consider initializing the variable with `common::database::options::Opt { level: Level::Global, root: Some(SPrivileged::User), bounding: Some(SBounding::Strict), ..Default::default() }` and removing relevant reassignments
   --> src/chsr/../database/options.rs:536:9
    |
536 |         let mut opt = Opt::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

Check warning on line 430 in src/chsr/../database/options.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

stripping a prefix manually

warning: stripping a prefix manually
   --> src/chsr/../database/options.rs:430:9
    |
430 |         &tzval[1..]
    |         ^^^^^^^^^^^
    |
note: the prefix was tested here
   --> src/chsr/../database/options.rs:429:17
    |
429 |     let tzval = if tzval.starts_with(':') {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip
    = note: `#[warn(clippy::manual_strip)]` on by default
help: try using the `strip_prefix` method
    |
429 ~     let tzval = if let Some(<stripped>) = tzval.strip_prefix(':') {
430 ~         <stripped>
    |

Check warning on line 399 in src/chsr/../database/options.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/../database/options.rs:399:9
    |
399 |         res.default_behavior = behavior;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: consider initializing the variable with `common::database::options::SEnvOptions { default_behavior: behavior, ..Default::default() }` and removing relevant reassignments
   --> src/chsr/../database/options.rs:398:9
    |
398 |         let mut res = SEnvOptions::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

Check warning on line 379 in src/chsr/../database/options.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/../database/options.rs:379:9
    |
379 |         res.default_behavior = behavior;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: consider initializing the variable with `common::database::options::SPathOptions { default_behavior: behavior, ..Default::default() }` and removing relevant reassignments
   --> src/chsr/../database/options.rs:378:9
    |
378 |         let mut res = 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 264 in src/chsr/../database/options.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/../database/options.rs:264:9
    |
264 |         timeout.type_field = Some(TimestampType::PPID);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: consider initializing the variable with `common::database::options::STimeout { type_field: Some(TimestampType::PPID), duration: Some(Duration::minutes(5)), ..Default::default() }` and removing relevant reassignments
   --> src/chsr/../database/options.rs:263:9
    |
263 |         let mut timeout = STimeout::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

Check warning on line 213 in src/chsr/../database/options.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/../database/options.rs:213:9
    |
213 |         opt.level = level;
    |         ^^^^^^^^^^^^^^^^^^
    |
note: consider initializing the variable with `common::database::options::Opt { level: level, ..Default::default() }` and removing relevant reassignments
   --> src/chsr/../database/options.rs:212:9
    |
212 |         let mut opt = Self::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

Check warning on line 89 in src/chsr/../database/options.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `impl` can be derived

warning: this `impl` can be derived
  --> src/chsr/../database/options.rs:80:1
   |
80 | / impl Default for STimeout {
81 | |     fn default() -> Self {
82 | |         STimeout {
83 | |             type_field: None,
...  |
88 | |     }
89 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
   = note: `#[warn(clippy::derivable_impls)]` on by default
   = help: remove the manual implementation...
help: ...and instead derive it
   |
64 + #[derive(Default)]
65 | pub struct STimeout {
   |

Check warning on line 60 in src/chsr/../database/options.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

name `UID` contains a capitalized acronym

warning: name `UID` contains a capitalized acronym
  --> src/chsr/../database/options.rs:60:5
   |
60 |     UID,
   |     ^^^ help: consider making the acronym lowercase, except the initial letter: `Uid`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

Check warning on line 59 in src/chsr/../database/options.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/chsr/../database/options.rs:59:5
   |
59 |     TTY,
   |     ^^^ 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

Check warning on line 58 in src/chsr/../database/options.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/chsr/../database/options.rs:58:5
   |
58 |     PPID,
   |     ^^^^ 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 12 in src/chsr/../database/migration.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/../database/migration.rs:12:15
   |
12 |     pub down: fn(&Self, &mut T) -> Result<(), Box<dyn Error>>,
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 11 in src/chsr/../database/migration.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/../database/migration.rs:11:13
   |
11 |     pub up: fn(&Self, &mut T) -> 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 546 in src/chsr/../database/finder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

assigning the result of `Clone::clone()` may be inefficient

warning: assigning the result of `Clone::clone()` may be inefficient
   --> src/chsr/../database/finder.rs:546:9
    |
546 |         settings.setgroups = setgid.clone();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `settings.setgroups.clone_from(setgid)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones

Check warning on line 545 in src/chsr/../database/finder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

assigning the result of `Clone::clone()` may be inefficient

warning: assigning the result of `Clone::clone()` may be inefficient
   --> src/chsr/../database/finder.rs:545:9
    |
545 |         settings.setuid = setuid.clone();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `settings.setuid.clone_from(setuid)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
    = note: `#[warn(clippy::assigning_clones)]` on by default

Check warning on line 103 in src/chsr/../database/finder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

all variants have the same postfix: `Match`

warning: all variants have the same postfix: `Match`
   --> src/chsr/../database/finder.rs:99:1
    |
99  | / pub enum UserMin {
100 | |     UserMatch,
101 | |     GroupMatch(usize),
102 | |     NoMatch,
103 | | }
    | |_^
    |
    = 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

Check warning on line 248 in src/chsr/../config.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/chsr/../config.rs:246:10
    |
246 |           .inspect_err(|e| {
    |  __________^
247 | |             debug!("Error reading file: {}", e);
248 | |         })
    | |__________^
    |
    = 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 296 in src/sr/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `std::result::Result` that must be used

warning: unused `std::result::Result` that must be used
   --> src/sr/main.rs:296:9
    |
296 |         recurse_pair(pair, &mut args);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
    = note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
    |
296 |         let _ = recurse_pair(pair, &mut args);
    |         +++++++