Skip to content
GitHub Actions / clippy failed Apr 29, 2024 in 2s

clippy

2 errors, 100 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 2
Warning 100
Note 0
Help 0

Versions

  • rustc 1.77.2 (25ef9e3d8 2024-04-09)
  • cargo 1.77.2 (e52e36006 2024-03-26)
  • clippy 0.1.77 (25ef9e3 2024-04-09)

Annotations

Check warning on line 97 in src/chsr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> src/chsr/../plugin/ssd.rs:97:57
   |
97 | fn groups_are_forbidden(groups: &Vec<Group>, ssd_roles: &Vec<String>, sconfig: &SConfig) -> bool {
   |                                                         ^^^^^^^^^^^^ help: change this to: `&[String]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

Check warning on line 72 in src/chsr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> src/chsr/../plugin/ssd.rs:72:46
   |
72 | fn user_is_forbidden(user: &User, ssd_roles: &Vec<String>, sconfig: &SConfig) -> bool {
   |                                              ^^^^^^^^^^^^ help: change this to: `&[String]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

Check warning on line 62 in src/chsr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> src/chsr/../plugin/ssd.rs:62:29
   |
62 | fn groups_subset_of(groups: &Vec<Group>, actors: &Vec<SActor>) -> bool {
   |                             ^^^^^^^^^^^ help: change this to: `&[Group]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

Check failure on line 43 in src/chsr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

equal expressions as operands to `==`

error: equal expressions as operands to `==`
  --> src/chsr/../plugin/ssd.rs:43:28
   |
43 |                         if group == group {
   |                            ^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#eq_op
   = note: `#[deny(clippy::eq_op)]` on by default

Check warning on line 37 in src/chsr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> src/chsr/../plugin/ssd.rs:37:46
   |
37 | fn group_contained_in(group: &Group, actors: &Vec<SActor>) -> bool {
   |                                              ^^^^^^^^^^^^ help: change this to: `&[SActor]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

Check warning on line 21 in src/chsr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> src/chsr/../plugin/ssd.rs:21:43
   |
21 | fn user_contained_in(user: &User, actors: &Vec<SActor>) -> bool {
   |                                           ^^^^^^^^^^^^ help: change this to: `&[SActor]`
   |
   = 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

Check warning on line 19 in src/chsr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

name `SSD` contains a capitalized acronym

warning: name `SSD` contains a capitalized acronym
  --> src/chsr/../plugin/ssd.rs:19:12
   |
19 | pub struct SSD(Vec<String>);
   |            ^^^ help: consider making the acronym lowercase, except the initial letter: `Ssd`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

Check warning on line 55 in src/chsr/../database/version.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

in an `if` condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`

warning: in an `if` condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
  --> src/chsr/../database/version.rs:51:23
   |
51 |           .and_then(|b| {
   |  _______________________^
52 | |             intermediate.version = version::PACKAGE_VERSION.to_owned().parse()?;
53 | |             debug!("Migrated from {}", intermediate.version);
54 | |             Ok(b)
55 | |         })
   | |_________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
   = note: `#[warn(clippy::blocks_in_conditions)]` 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 328 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:324:13
    |
324 |               for group in res {
    |               ^            --- help: try: `res.flatten()`
    |  _____________|
    | |
325 | |                 if let Some(group) = group {
326 | |                     groups.push(group.gid.as_raw());
327 | |                 }
328 | |             }
    | |_____________^
    |
help: ...and remove the `if let` statement in the for loop
   --> src/sr/main.rs:325:17
    |
325 | /                 if let Some(group) = group {
326 | |                     groups.push(group.gid.as_raw());
327 | |                 }
    | |_________________^
    = 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 35 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:35:5
   |
35 |     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 34 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:34:5
   |
34 |     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

Check warning on line 97 in src/sr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> src/sr/../plugin/ssd.rs:97:57
   |
97 | fn groups_are_forbidden(groups: &Vec<Group>, ssd_roles: &Vec<String>, sconfig: &SConfig) -> bool {
   |                                                         ^^^^^^^^^^^^ help: change this to: `&[String]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

Check warning on line 72 in src/sr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> src/sr/../plugin/ssd.rs:72:46
   |
72 | fn user_is_forbidden(user: &User, ssd_roles: &Vec<String>, sconfig: &SConfig) -> bool {
   |                                              ^^^^^^^^^^^^ help: change this to: `&[String]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

Check warning on line 62 in src/sr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> src/sr/../plugin/ssd.rs:62:29
   |
62 | fn groups_subset_of(groups: &Vec<Group>, actors: &Vec<SActor>) -> bool {
   |                             ^^^^^^^^^^^ help: change this to: `&[Group]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

Check failure on line 43 in src/sr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

equal expressions as operands to `==`

error: equal expressions as operands to `==`
  --> src/sr/../plugin/ssd.rs:43:28
   |
43 |                         if group == group {
   |                            ^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#eq_op
   = note: `#[deny(clippy::eq_op)]` on by default

Check warning on line 37 in src/sr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> src/sr/../plugin/ssd.rs:37:46
   |
37 | fn group_contained_in(group: &Group, actors: &Vec<SActor>) -> bool {
   |                                              ^^^^^^^^^^^^ help: change this to: `&[SActor]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg

Check warning on line 21 in src/sr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> src/sr/../plugin/ssd.rs:21:43
   |
21 | fn user_contained_in(user: &User, actors: &Vec<SActor>) -> bool {
   |                                           ^^^^^^^^^^^^ help: change this to: `&[SActor]`
   |
   = 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

Check warning on line 19 in src/sr/../plugin/ssd.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

name `SSD` contains a capitalized acronym

warning: name `SSD` contains a capitalized acronym
  --> src/sr/../plugin/ssd.rs:19:12
   |
19 | pub struct SSD(Vec<String>);
   |            ^^^ help: consider making the acronym lowercase, except the initial letter: `Ssd`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms

Check warning on line 586 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:582:10
    |
582 |       ) -> (
    |  __________^
583 | |         PathBehavior,
584 | |         Rc<RefCell<LinkedHashSet<String>>>,
585 | |         Rc<RefCell<LinkedHashSet<String>>>,
586 | |     ) {
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 475 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:475:9
    |
475 |         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:474:9
    |
474 |         let mut opt = Opt::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default