v3.0.0-alpha.5 #244
Annotations
124 warnings
current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`:
src/chsr/../mod.rs#L117
warning: current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`
--> src/chsr/../mod.rs:117:44
|
117 | let res = std::fs::File::create(p).inspect_err(|e| {
| ____________________________________________^
118 | | debug!(
119 | | "Error creating file without privilege, trying with privileges: {}",
120 | | e
121 | | );
122 | | });
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
|
methods called `into_*` usually take `self` by value:
src/chsr/../database/structs.rs#L573
warning: methods called `into_*` usually take `self` by value
--> src/chsr/../database/structs.rs:573:22
|
573 | 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
|
methods called `into_*` usually take `self` by value:
src/chsr/../database/structs.rs#L567
warning: methods called `into_*` usually take `self` by value
--> src/chsr/../database/structs.rs:567:23
|
567 | 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
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/structs.rs#L410
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/../database/structs.rs:410:9
|
410 | 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:409:9
|
409 | let mut ret = STask::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/structs.rs#L393
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/../database/structs.rs:393:9
|
393 | 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:392:9
|
392 | let mut ret = SRole::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/structs.rs#L328
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/../database/structs.rs:328:9
|
328 | 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:327:9
|
327 | let mut c = SCapabilities::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
assigning the result of `Clone::clone()` may be inefficient:
src/chsr/../database/options.rs#L902
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/chsr/../database/options.rs:902:25
|
902 | final_set = p.set.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `final_set.clone_from(&p.set)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
|
assigning the result of `Clone::clone()` may be inefficient:
src/chsr/../database/options.rs#L880
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/chsr/../database/options.rs:880:25
|
880 | final_set = p.set.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `final_set.clone_from(&p.set)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
|
very complex type used. Consider factoring parts into `type` definitions:
src/chsr/../database/options.rs#L847
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/chsr/../database/options.rs:847:10
|
847 | ) -> (
| __________^
848 | | EnvBehavior,
849 | | HashMap<String, String>,
850 | | LinkedHashSet<EnvKey>,
851 | | LinkedHashSet<EnvKey>,
852 | | LinkedHashSet<EnvKey>,
853 | | ) {
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
very complex type used. Consider factoring parts into `type` definitions:
src/chsr/../database/options.rs#L714
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/chsr/../database/options.rs:714:10
|
714 | ) -> (
| __________^
715 | | PathBehavior,
716 | | Rc<RefCell<LinkedHashSet<String>>>,
717 | | Rc<RefCell<LinkedHashSet<String>>>,
718 | | ) {
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
very complex type used. Consider factoring parts into `type` definitions:
src/chsr/../database/options.rs#L659
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/chsr/../database/options.rs:659:10
|
659 | ) -> (
| __________^
660 | | PathBehavior,
661 | | Rc<RefCell<LinkedHashSet<String>>>,
662 | | Rc<RefCell<LinkedHashSet<String>>>,
663 | | ) {
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/options.rs#L571
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/../database/options.rs:571:9
|
571 | 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:570:9
|
570 | let mut opt = Opt::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
stripping a prefix manually:
src/chsr/../database/options.rs#L463
warning: stripping a prefix manually
--> src/chsr/../database/options.rs:463:9
|
463 | &tzval[1..]
| ^^^^^^^^^^^
|
note: the prefix was tested here
--> src/chsr/../database/options.rs:462:17
|
462 | 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
|
462 ~ let tzval = if let Some(<stripped>) = tzval.strip_prefix(':') {
463 ~ <stripped>
|
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/options.rs#L416
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/../database/options.rs:416:9
|
416 | 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:415:9
|
415 | let mut res = SEnvOptions::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/options.rs#L395
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/../database/options.rs:395:9
|
395 | 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:394:9
|
394 | let mut res = SPathOptions::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/options.rs#L276
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/../database/options.rs:276:9
|
276 | 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:275:9
|
275 | let mut timeout = STimeout::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/options.rs#L224
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/../database/options.rs:224:9
|
224 | 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:223:9
|
223 | let mut opt = Self::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
direct implementation of `ToString`:
src/chsr/../database/options.rs#L130
warning: direct implementation of `ToString`
--> src/chsr/../database/options.rs:130:1
|
130 | / impl ToString for EnvKey {
131 | | fn to_string(&self) -> String {
132 | | self.value.clone()
133 | | }
134 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
= note: `#[warn(clippy::to_string_trait_impl)]` on by default
|
name `UID` contains a capitalized acronym:
src/chsr/../database/options.rs#L63
warning: name `UID` contains a capitalized acronym
--> src/chsr/../database/options.rs:63:5
|
63 | 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
|
name `TTY` contains a capitalized acronym:
src/chsr/../database/options.rs#L62
warning: name `TTY` contains a capitalized acronym
--> src/chsr/../database/options.rs:62:5
|
62 | 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
|
name `PPID` contains a capitalized acronym:
src/chsr/../database/options.rs#L61
warning: name `PPID` contains a capitalized acronym
--> src/chsr/../database/options.rs:61:5
|
61 | 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
|
very complex type used. Consider factoring parts into `type` definitions:
src/chsr/../database/migration.rs#L12
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
|
very complex type used. Consider factoring parts into `type` definitions:
src/chsr/../database/migration.rs#L11
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
|
assigning the result of `Clone::clone()` may be inefficient:
src/chsr/../database/finder.rs#L621
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/chsr/../database/finder.rs:621:9
|
621 | 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
|
assigning the result of `Clone::clone()` may be inefficient:
src/chsr/../database/finder.rs#L620
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/chsr/../database/finder.rs:620:9
|
620 | 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
|
unnecessary `if let` since only the `Some` variant of the iterator element is used:
src/sr/main.rs#L402
warning: unnecessary `if let` since only the `Some` variant of the iterator element is used
--> src/sr/main.rs:402:13
|
402 | for group in res {
| ^ --- help: try: `res.flatten()`
| _____________|
| |
403 | | if let Some(group) = group {
404 | | groups.push(group.gid.as_raw());
405 | | }
406 | | }
| |_____________^
|
help: ...and remove the `if let` statement in the for loop
--> src/sr/main.rs:403:17
|
403 | / if let Some(group) = group {
404 | | groups.push(group.gid.as_raw());
405 | | }
| |_________________^
= 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
|
all variants have the same postfix: `Match`:
src/chsr/../database/finder.rs#L126
warning: all variants have the same postfix: `Match`
--> src/chsr/../database/finder.rs:126:1
|
126 | / pub enum UserMin {
127 | | UserMatch,
128 | | GroupMatch(usize),
129 | | NoMatch,
130 | | }
| |_^
|
= 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
|
current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`:
src/chsr/../config.rs#L250
warning: current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`
--> src/chsr/../config.rs:250:10
|
250 | .inspect_err(|e| {
| __________^
251 | | debug!("Error reading file: {}", e);
252 | | })
| |__________^
|
= 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
|
returning the result of a `let` binding from a block:
src/sr/main.rs#L326
warning: returning the result of a `let` binding from a block
--> src/sr/main.rs:326:5
|
320 | / let user = Cred {
321 | | user,
322 | | groups,
323 | | tty,
324 | | ppid,
325 | | };
| |______- unnecessary `let` binding
326 | 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
|
320 ~
321 ~ Cred {
322 + user,
323 + groups,
324 + tty,
325 + ppid,
326 + }
|
|
`to_string` applied to a type that implements `Display` in `eprintln!` args:
src/sr/main.rs#L281
warning: `to_string` applied to a type that implements `Display` in `eprintln!` args
--> src/sr/main.rs:281:68
|
281 | 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
|
current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`:
src/sr/main.rs#L216
warning: current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`
--> src/sr/main.rs:216:14
|
216 | .inspect_err(|e| {
| ______________^
217 | | error!("{}", e);
218 | | })
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
|
this loop could be written as a `for` loop:
src/sr/main.rs#L179
warning: this loop could be written as a `for` loop
--> src/sr/main.rs:179:5
|
179 | 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
|
the borrowed expression implements the required traits:
src/sr/timeout.rs#L182
warning: the borrowed expression implements the required traits
--> src/sr/timeout.rs:182:15
|
182 | .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
|
the borrowed expression implements the required traits:
src/sr/timeout.rs#L179
warning: the borrowed expression implements the required traits
--> src/sr/timeout.rs:179:44
|
179 | 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
|
the borrowed expression implements the required traits:
src/sr/timeout.rs#L162
warning: the borrowed expression implements the required traits
--> src/sr/timeout.rs:162:44
|
162 | 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
|
name `PPID` contains a capitalized acronym:
src/sr/timeout.rs#L38
warning: name `PPID` contains a capitalized acronym
--> src/sr/timeout.rs:38:5
|
38 | 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
|
name `TTY` contains a capitalized acronym:
src/sr/timeout.rs#L37
warning: name `TTY` contains a capitalized acronym
--> src/sr/timeout.rs:37:5
|
37 | 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
|
name `JSON` contains a capitalized acronym:
src/chsr/../config.rs#L88
warning: name `JSON` contains a capitalized acronym
--> src/chsr/../config.rs:88:5
|
88 | JSON(Rc<RefCell<SConfig>>),
| ^^^^ help: consider making the acronym lowercase, except the initial letter: `Json`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
|
name `JSON` contains a capitalized acronym:
src/chsr/../config.rs#L78
warning: name `JSON` contains a capitalized acronym
--> src/chsr/../config.rs:78:5
|
78 | JSON,
| ^^^^ help: consider making the acronym lowercase, except the initial letter: `Json`
|
= 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
|
current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`:
src/sr/../mod.rs#L117
warning: current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`
--> src/sr/../mod.rs:117:44
|
117 | let res = std::fs::File::create(p).inspect_err(|e| {
| ____________________________________________^
118 | | debug!(
119 | | "Error creating file without privilege, trying with privileges: {}",
120 | | e
121 | | );
122 | | });
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
|
assigning the result of `Clone::clone()` may be inefficient:
src/chsr/cli/process/json.rs#L1012
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/chsr/cli/process/json.rs:1012:21
|
1012 | env.set = options_env_values.as_ref().unwrap().clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `env.set.clone_from(options_env_values.as_ref().unwrap())`
|
= 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
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/cli/process/json.rs#L887
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/cli/process/json.rs:887:13
|
887 | path.default_behavior = options_path_policy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `common::database::options::SPathOptions { default_behavior: options_path_policy, ..Default::default() }` and removing relevant reassignments
--> src/chsr/cli/process/json.rs:886:13
|
886 | let mut path = SPathOptions::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/cli/process/json.rs#L609
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/cli/process/json.rs:609:9
|
609 | env.default_behavior = options_env_policy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `common::database::options::SEnvOptions { default_behavior: options_env_policy, ..Default::default() }` and removing relevant reassignments
--> src/chsr/cli/process/json.rs:608:9
|
608 | 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
|
methods called `into_*` usually take `self` by value:
src/sr/../database/structs.rs#L573
warning: methods called `into_*` usually take `self` by value
--> src/sr/../database/structs.rs:573:22
|
573 | 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
|
methods called `into_*` usually take `self` by value:
src/sr/../database/structs.rs#L567
warning: methods called `into_*` usually take `self` by value
--> src/sr/../database/structs.rs:567:23
|
567 | 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
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/structs.rs#L410
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../database/structs.rs:410:9
|
410 | 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/sr/../database/structs.rs:409:9
|
409 | let mut ret = STask::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/structs.rs#L393
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../database/structs.rs:393:9
|
393 | 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/sr/../database/structs.rs:392:9
|
392 | let mut ret = SRole::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/structs.rs#L328
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../database/structs.rs:328:9
|
328 | c.add = capset;
| ^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `common::database::structs::SCapabilities { add: capset, ..Default::default() }` and removing relevant reassignments
--> src/sr/../database/structs.rs:327:9
|
327 | let mut c = SCapabilities::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
very complex type used. Consider factoring parts into `type` definitions:
src/chsr/cli/pair.rs#L25
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/chsr/cli/pair.rs:25:18
|
25 | 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
|
all variants have the same postfix: `List`:
src/chsr/cli/data.rs#L46
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
|
assigning the result of `Clone::clone()` may be inefficient:
src/sr/../database/options.rs#L902
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/sr/../database/options.rs:902:25
|
902 | final_set = p.set.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `final_set.clone_from(&p.set)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
|
assigning the result of `Clone::clone()` may be inefficient:
src/sr/../database/options.rs#L880
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/sr/../database/options.rs:880:25
|
880 | final_set = p.set.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `final_set.clone_from(&p.set)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
|
very complex type used. Consider factoring parts into `type` definitions:
src/sr/../database/options.rs#L847
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/sr/../database/options.rs:847:10
|
847 | ) -> (
| __________^
848 | | EnvBehavior,
849 | | HashMap<String, String>,
850 | | LinkedHashSet<EnvKey>,
851 | | LinkedHashSet<EnvKey>,
852 | | LinkedHashSet<EnvKey>,
853 | | ) {
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
very complex type used. Consider factoring parts into `type` definitions:
src/sr/../database/options.rs#L714
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/sr/../database/options.rs:714:10
|
714 | ) -> (
| __________^
715 | | PathBehavior,
716 | | Rc<RefCell<LinkedHashSet<String>>>,
717 | | Rc<RefCell<LinkedHashSet<String>>>,
718 | | ) {
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
very complex type used. Consider factoring parts into `type` definitions:
src/sr/../database/options.rs#L659
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/sr/../database/options.rs:659:10
|
659 | ) -> (
| __________^
660 | | PathBehavior,
661 | | Rc<RefCell<LinkedHashSet<String>>>,
662 | | Rc<RefCell<LinkedHashSet<String>>>,
663 | | ) {
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
associated function `default` is never used:
src/chsr/../database/wrapper.rs#L15
warning: associated function `default` is never used
--> src/chsr/../database/wrapper.rs:15:8
|
14 | pub trait DefaultWrapper {
| -------------- associated function in this trait
15 | fn default() -> Self;
| ^^^^^^^
|
associated functions `from_user_id`, `from_group_id`, and `from_group_vec_id` are never used:
src/chsr/../database/structs.rs#L637
warning: associated functions `from_user_id`, `from_group_id`, and `from_group_vec_id` are never used
--> src/chsr/../database/structs.rs:637:12
|
630 | impl SActor {
| ----------- associated functions in this implementation
...
637 | pub fn from_user_id(id: u32) -> Self {
| ^^^^^^^^^^^^
...
649 | pub fn from_group_id(id: u32) -> Self {
| ^^^^^^^^^^^^^
...
663 | pub fn from_group_vec_id(groups: Vec<u32>) -> Self {
| ^^^^^^^^^^^^^^^^^
|
method `config` is never used:
src/chsr/../database/structs.rs#L397
warning: method `config` is never used
--> src/chsr/../database/structs.rs:397:12
|
390 | impl SRole {
| ---------- method in this implementation
...
397 | pub fn config(&self) -> Option<Rc<RefCell<SConfig>>> {
| ^^^^^^
|
methods `get_opt`, `calculate_path`, `calculate_filtered_env`, and `get_lowest_level` are never used:
src/chsr/../database/options.rs#L598
warning: methods `get_opt`, `calculate_path`, `calculate_filtered_env`, and `get_lowest_level` are never used
--> src/chsr/../database/options.rs:598:8
|
524 | impl OptStack {
| ------------- methods in this implementation
...
598 | fn get_opt(&self, level: Level) -> Option<Rc<RefCell<Opt>>> {
| ^^^^^^^
...
623 | fn calculate_path(&self) -> String {
| ^^^^^^^^^^^^^^
...
782 | pub fn calculate_filtered_env<I>(
| ^^^^^^^^^^^^^^^^^^^^^^
...
1077 | fn get_lowest_level(&self) -> Level {
| ^^^^^^^^^^^^^^^^
|
function `check_env` is never used:
src/chsr/../database/options.rs#L508
warning: function `check_env` is never used
--> src/chsr/../database/options.rs:508:4
|
508 | fn check_env(key: &str, value: &str) -> bool {
| ^^^^^^^^^
|
function `tz_is_safe` is never used:
src/chsr/../database/options.rs#L460
warning: function `tz_is_safe` is never used
--> src/chsr/../database/options.rs:460:4
|
460 | fn tz_is_safe(tzval: &str) -> bool {
| ^^^^^^^^^^
|
associated function `new` is never used:
src/chsr/../database/options.rs#L393
warning: associated function `new` is never used
--> src/chsr/../database/options.rs:393:8
|
392 | impl SPathOptions {
| ----------------- associated function in this implementation
393 | fn new(behavior: PathBehavior) -> Self {
| ^^^
|
methods `task` and `role` are never used:
src/chsr/../database/finder.rs#L84
warning: methods `task` and `role` are never used
--> src/chsr/../database/finder.rs:84:12
|
71 | impl ExecSettings {
| ----------------- methods in this implementation
...
84 | pub fn task(&self) -> Rc<RefCell<STask>> {
| ^^^^
...
88 | pub fn role(&self) -> Rc<RefCell<SRole>> {
| ^^^^
|
multiple associated functions are never used:
src/chsr/../api.rs#L105
warning: multiple associated functions are never used
--> src/chsr/../api.rs:105:12
|
87 | impl PluginManager {
| ------------------ associated functions in this implementation
...
105 | pub fn subscribe_task_matcher(plugin: TaskMatcher) {
| ^^^^^^^^^^^^^^^^^^^^^^
...
109 | pub fn subscribe_user_matcher(plugin: UserMatcher) {
| ^^^^^^^^^^^^^^^^^^^^^^
...
117 | pub fn subscribe_task_separation(plugin: TaskSeparation) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
...
121 | pub fn subscribe_caps_filter(plugin: CapsFilter) {
| ^^^^^^^^^^^^^^^^^^^^^
...
125 | pub fn subscribe_privilege_checker(plugin: ExecutionChecker) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
154 | pub fn notify_task_matcher(
| ^^^^^^^^^^^^^^^^^^^
...
193 | pub fn notify_task_separation(task: &STask, actor: &Cred) -> PluginResult {
| ^^^^^^^^^^^^^^^^^^^^^^
...
204 | pub fn notify_caps_filter(task: &STask, capabilities: &mut CapSet) -> PluginResultAction {
| ^^^^^^^^^^^^^^^^^^
...
216 | pub fn notify_privilege_checker(user: &Cred, exec: &mut ExecSettings) -> PluginResult {
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
fields `task_matcher_plugins`, `task_separation_plugins`, `caps_filter_plugins`, and `execution_checker_plugins` are never read:
src/chsr/../api.rs#L78
warning: fields `task_matcher_plugins`, `task_separation_plugins`, `caps_filter_plugins`, and `execution_checker_plugins` are never read
--> src/chsr/../api.rs:78:5
|
76 | pub struct PluginManager {
| ------------- fields in this struct
77 | role_matcher_plugins: Vec<RoleMatcher>,
78 | task_matcher_plugins: Vec<TaskMatcher>,
| ^^^^^^^^^^^^^^^^^^^^
...
81 | task_separation_plugins: Vec<TaskSeparation>,
| ^^^^^^^^^^^^^^^^^^^^^^^
82 | caps_filter_plugins: Vec<CapsFilter>,
| ^^^^^^^^^^^^^^^^^^^
83 | execution_checker_plugins: Vec<ExecutionChecker>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
type alias `TaskInformation` is never used:
src/chsr/../api.rs#L57
warning: type alias `TaskInformation` is never used
--> src/chsr/../api.rs:57:10
|
57 | pub type TaskInformation = fn(task: &STask) -> Option<String>;
| ^^^^^^^^^^^^^^^
|
type alias `ActorInformation` is never used:
src/chsr/../api.rs#L56
warning: type alias `ActorInformation` is never used
--> src/chsr/../api.rs:56:10
|
56 | pub type ActorInformation = fn(actor: &SActor) -> Option<String>;
| ^^^^^^^^^^^^^^^^
|
type alias `RoleInformation` is never used:
src/chsr/../api.rs#L55
warning: type alias `RoleInformation` is never used
--> src/chsr/../api.rs:55:10
|
55 | pub type RoleInformation = fn(role: &SRole) -> Option<String>;
| ^^^^^^^^^^^^^^^
|
type alias `ConfigLoaded` is never used:
src/chsr/../api.rs#L37
warning: type alias `ConfigLoaded` is never used
--> src/chsr/../api.rs:37:10
|
37 | pub type ConfigLoaded = fn(config: &SConfig);
| ^^^^^^^^^^^^
|
variant `Override` is never constructed:
src/chsr/../api.rs#L26
warning: variant `Override` is never constructed
--> src/chsr/../api.rs:26:5
|
25 | pub enum PluginResultAction {
| ------------------ variant in this enum
26 | Override, // The result of this plugin ends the algorithm to return the plugin result
| ^^^^^^^^
|
= note: `PluginResultAction` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
|
trait `Plugin` is never used:
src/chsr/../api.rs#L19
warning: trait `Plugin` is never used
--> src/chsr/../api.rs:19:11
|
19 | pub trait Plugin {
| ^^^^^^
|
function `create_dir_all_with_privileges` is never used:
src/chsr/../mod.rs#L155
warning: function `create_dir_all_with_privileges` is never used
--> src/chsr/../mod.rs:155:8
|
155 | pub fn create_dir_all_with_privileges<P: AsRef<Path>>(p: P) -> Result<(), std::io::Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
function `remove_with_privileges` is never used:
src/chsr/../mod.rs#L142
warning: function `remove_with_privileges` is never used
--> src/chsr/../mod.rs:142:8
|
142 | pub fn remove_with_privileges<P: AsRef<Path>>(p: P) -> Result<(), std::io::Error> {
| ^^^^^^^^^^^^^^^^^^^^^^
|
function `activates_no_new_privs` is never used:
src/chsr/../mod.rs#L97
warning: function `activates_no_new_privs` is never used
--> src/chsr/../mod.rs:97:8
|
97 | pub fn activates_no_new_privs() -> Result<(), capctl::Error> {
| ^^^^^^^^^^^^^^^^^^^^^^
|
function `setgid_effective` is never used:
src/chsr/../mod.rs#L77
warning: function `setgid_effective` is never used
--> src/chsr/../mod.rs:77:8
|
77 | pub fn setgid_effective(enable: bool) -> Result<(), capctl::Error> {
| ^^^^^^^^^^^^^^^^
|
function `setuid_effective` is never used:
src/chsr/../mod.rs#L73
warning: function `setuid_effective` is never used
--> src/chsr/../mod.rs:73:8
|
73 | pub fn setuid_effective(enable: bool) -> Result<(), capctl::Error> {
| ^^^^^^^^^^^^^^^^
|
function `setpcap_effective` is never used:
src/chsr/../mod.rs#L69
warning: function `setpcap_effective` is never used
--> src/chsr/../mod.rs:69:8
|
69 | pub fn setpcap_effective(enable: bool) -> Result<(), capctl::Error> {
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/options.rs#L571
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../database/options.rs:571:9
|
571 | 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/sr/../database/options.rs:570:9
|
570 | let mut opt = Opt::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
stripping a prefix manually:
src/sr/../database/options.rs#L463
warning: stripping a prefix manually
--> src/sr/../database/options.rs:463:9
|
463 | &tzval[1..]
| ^^^^^^^^^^^
|
note: the prefix was tested here
--> src/sr/../database/options.rs:462:17
|
462 | 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
|
462 ~ let tzval = if let Some(<stripped>) = tzval.strip_prefix(':') {
463 ~ <stripped>
|
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/options.rs#L416
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../database/options.rs:416:9
|
416 | res.default_behavior = behavior;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `common::database::options::SEnvOptions { default_behavior: behavior, ..Default::default() }` and removing relevant reassignments
--> src/sr/../database/options.rs:415:9
|
415 | let mut res = SEnvOptions::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/options.rs#L395
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../database/options.rs:395:9
|
395 | res.default_behavior = behavior;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `common::database::options::SPathOptions { default_behavior: behavior, ..Default::default() }` and removing relevant reassignments
--> src/sr/../database/options.rs:394:9
|
394 | let mut res = SPathOptions::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/options.rs#L276
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../database/options.rs:276:9
|
276 | 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/sr/../database/options.rs:275:9
|
275 | let mut timeout = STimeout::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/options.rs#L224
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../database/options.rs:224:9
|
224 | opt.level = level;
| ^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `common::database::options::Opt { level: level, ..Default::default() }` and removing relevant reassignments
--> src/sr/../database/options.rs:223:9
|
223 | let mut opt = Self::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
|
direct implementation of `ToString`:
src/sr/../database/options.rs#L130
warning: direct implementation of `ToString`
--> src/sr/../database/options.rs:130:1
|
130 | / impl ToString for EnvKey {
131 | | fn to_string(&self) -> String {
132 | | self.value.clone()
133 | | }
134 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
= note: `#[warn(clippy::to_string_trait_impl)]` on by default
|
name `UID` contains a capitalized acronym:
src/sr/../database/options.rs#L63
warning: name `UID` contains a capitalized acronym
--> src/sr/../database/options.rs:63:5
|
63 | 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
|
name `TTY` contains a capitalized acronym:
src/sr/../database/options.rs#L62
warning: name `TTY` contains a capitalized acronym
--> src/sr/../database/options.rs:62:5
|
62 | 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
|
name `PPID` contains a capitalized acronym:
src/sr/../database/options.rs#L61
warning: name `PPID` contains a capitalized acronym
--> src/sr/../database/options.rs:61:5
|
61 | 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
|
very complex type used. Consider factoring parts into `type` definitions:
src/sr/../database/migration.rs#L12
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/sr/../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
|
very complex type used. Consider factoring parts into `type` definitions:
src/sr/../database/migration.rs#L11
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/sr/../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
|
assigning the result of `Clone::clone()` may be inefficient:
src/sr/../database/finder.rs#L621
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/sr/../database/finder.rs:621:9
|
621 | 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
|
assigning the result of `Clone::clone()` may be inefficient:
src/sr/../database/finder.rs#L620
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/sr/../database/finder.rs:620:9
|
620 | 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
|
all variants have the same postfix: `Match`:
src/sr/../database/finder.rs#L126
warning: all variants have the same postfix: `Match`
--> src/sr/../database/finder.rs:126:1
|
126 | / pub enum UserMin {
127 | | UserMatch,
128 | | GroupMatch(usize),
129 | | NoMatch,
130 | | }
| |_^
|
= 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
|
current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`:
src/sr/../config.rs#L250
warning: current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`
--> src/sr/../config.rs:250:10
|
250 | .inspect_err(|e| {
| __________^
251 | | debug!("Error reading file: {}", e);
252 | | })
| |__________^
|
= 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
|
name `JSON` contains a capitalized acronym:
src/sr/../config.rs#L88
warning: name `JSON` contains a capitalized acronym
--> src/sr/../config.rs:88:5
|
88 | JSON(Rc<RefCell<SConfig>>),
| ^^^^ help: consider making the acronym lowercase, except the initial letter: `Json`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms
|
name `JSON` contains a capitalized acronym:
src/sr/../config.rs#L78
warning: name `JSON` contains a capitalized acronym
--> src/sr/../config.rs:78:5
|
78 | JSON,
| ^^^^ help: consider making the acronym lowercase, except the initial letter: `Json`
|
= 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
|
method `leak` is never used:
src/sr/pam/securemem.rs#L29
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> {
| ^^^^
|
function `errno_location` is never used:
src/sr/pam/cutils.rs#L27
warning: function `errno_location` is never used
--> src/sr/pam/cutils.rs:27:8
|
27 | fn errno_location() -> *mut libc::c_int;
| ^^^^^^^^^^^^^^
|
function `safe_isatty` is never used:
src/sr/pam/cutils.rs#L72
warning: function `safe_isatty` is never used
--> src/sr/pam/cutils.rs:72:8
|
72 | pub fn safe_isatty(fildes: libc::c_int) -> bool {
| ^^^^^^^^^^^
|
function `os_string_from_ptr` is never used:
src/sr/pam/cutils.rs#L60
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 {
| ^^^^^^^^^^^^^^^^^^
|
function `string_from_ptr` is never used:
src/sr/pam/cutils.rs#L46
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 {
| ^^^^^^^^^^^^^^^
|
function `sysconf` is never used:
src/sr/pam/cutils.rs#L34
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> {
| ^^^^^^^
|
function `set_errno` is never used:
src/sr/pam/cutils.rs#L30
warning: function `set_errno` is never used
--> src/sr/pam/cutils.rs:30:8
|
30 | pub fn set_errno(no: libc::c_int) {
| ^^^^^^^^^
|
constant `RED` is never used:
src/sr/../util.rs#L16
warning: constant `RED` is never used
--> src/sr/../util.rs:16:11
|
16 | pub const RED: &str = "\x1B[31m";
| ^^^
|
associated function `default` is never used:
src/sr/../database/wrapper.rs#L15
warning: associated function `default` is never used
--> src/sr/../database/wrapper.rs:15:8
|
14 | pub trait DefaultWrapper {
| -------------- associated function in this trait
15 | fn default() -> Self;
| ^^^^^^^
|
multiple associated functions are never used:
src/sr/../database/structs.rs#L631
warning: multiple associated functions are never used
--> src/sr/../database/structs.rs:631:12
|
630 | impl SActor {
| ----------- associated functions in this implementation
631 | pub fn from_user_string(user: &str) -> Self {
| ^^^^^^^^^^^^^^^^
...
637 | pub fn from_user_id(id: u32) -> Self {
| ^^^^^^^^^^^^
...
643 | pub fn from_group_string(group: &str) -> Self {
| ^^^^^^^^^^^^^^^^^
...
649 | pub fn from_group_id(id: u32) -> Self {
| ^^^^^^^^^^^^^
...
655 | pub fn from_group_vec_string(group: Vec<&str>) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^
...
663 | pub fn from_group_vec_id(groups: Vec<u32>) -> Self {
| ^^^^^^^^^^^^^^^^^
...
671 | pub fn from_group_vec_actors(groups: Vec<SActorType>) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^
|
associated function `new` is never used:
src/sr/../database/structs.rs#L408
warning: associated function `new` is never used
--> src/sr/../database/structs.rs:408:12
|
407 | impl STask {
| ---------- associated function in this implementation
408 | pub fn new(name: IdTask, role: Weak<RefCell<SRole>>) -> Self {
| ^^^
|
associated items `new`, `config`, and `task` are never used:
src/sr/../database/structs.rs#L391
warning: associated items `new`, `config`, and `task` are never used
--> src/sr/../database/structs.rs:391:12
|
390 | impl SRole {
| ---------- associated items in this implementation
391 | pub fn new(name: String, config: Weak<RefCell<SConfig>>) -> Self {
| ^^^
...
397 | pub fn config(&self) -> Option<Rc<RefCell<SConfig>>> {
| ^^^^^^
...
400 | pub fn task(&self, name: &IdTask) -> Option<&Rc<RefCell<STask>>> {
| ^^^^
|
method `task` is never used:
src/sr/../database/structs.rs#L383
warning: method `task` is never used
--> src/sr/../database/structs.rs:383:12
|
379 | impl SConfig {
| ------------ method in this implementation
...
383 | pub fn task(&self, role: &str, name: &IdTask) -> Result<Rc<RefCell<STask>>, Box<dyn Error>> {
| ^^^^
|
methods `get_opt`, `get_lowest_level`, and `to_opt` are never used:
src/sr/../database/options.rs#L598
warning: methods `get_opt`, `get_lowest_level`, and `to_opt` are never used
--> src/sr/../database/options.rs:598:8
|
524 | impl OptStack {
| ------------- methods in this implementation
...
598 | fn get_opt(&self, level: Level) -> Option<Rc<RefCell<Opt>>> {
| ^^^^^^^
...
1077 | fn get_lowest_level(&self) -> Level {
| ^^^^^^^^^^^^^^^^
...
1087 | pub fn to_opt(&self) -> Opt {
| ^^^^^^
|
associated function `new` is never used:
src/sr/../database/options.rs#L393
warning: associated function `new` is never used
--> src/sr/../database/options.rs:393:8
|
392 | impl SPathOptions {
| ----------------- associated function in this implementation
393 | fn new(behavior: PathBehavior) -> Self {
| ^^^
|
multiple associated functions are never used:
src/sr/../api.rs#L105
warning: multiple associated functions are never used
--> src/sr/../api.rs:105:12
|
87 | impl PluginManager {
| ------------------ associated functions in this implementation
...
105 | pub fn subscribe_task_matcher(plugin: TaskMatcher) {
| ^^^^^^^^^^^^^^^^^^^^^^
...
109 | pub fn subscribe_user_matcher(plugin: UserMatcher) {
| ^^^^^^^^^^^^^^^^^^^^^^
...
117 | pub fn subscribe_task_separation(plugin: TaskSeparation) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
...
121 | pub fn subscribe_caps_filter(plugin: CapsFilter) {
| ^^^^^^^^^^^^^^^^^^^^^
...
125 | pub fn subscribe_privilege_checker(plugin: ExecutionChecker) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
154 | pub fn notify_task_matcher(
| ^^^^^^^^^^^^^^^^^^^
...
193 | pub fn notify_task_separation(task: &STask, actor: &Cred) -> PluginResult {
| ^^^^^^^^^^^^^^^^^^^^^^
...
204 | pub fn notify_caps_filter(task: &STask, capabilities: &mut CapSet) -> PluginResultAction {
| ^^^^^^^^^^^^^^^^^^
...
216 | pub fn notify_privilege_checker(user: &Cred, exec: &mut ExecSettings) -> PluginResult {
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
fields `task_matcher_plugins`, `task_separation_plugins`, `caps_filter_plugins`, and `execution_checker_plugins` are never read:
src/sr/../api.rs#L78
warning: fields `task_matcher_plugins`, `task_separation_plugins`, `caps_filter_plugins`, and `execution_checker_plugins` are never read
--> src/sr/../api.rs:78:5
|
76 | pub struct PluginManager {
| ------------- fields in this struct
77 | role_matcher_plugins: Vec<RoleMatcher>,
78 | task_matcher_plugins: Vec<TaskMatcher>,
| ^^^^^^^^^^^^^^^^^^^^
...
81 | task_separation_plugins: Vec<TaskSeparation>,
| ^^^^^^^^^^^^^^^^^^^^^^^
82 | caps_filter_plugins: Vec<CapsFilter>,
| ^^^^^^^^^^^^^^^^^^^
83 | execution_checker_plugins: Vec<ExecutionChecker>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
type alias `TaskInformation` is never used:
src/sr/../api.rs#L57
warning: type alias `TaskInformation` is never used
--> src/sr/../api.rs:57:10
|
57 | pub type TaskInformation = fn(task: &STask) -> Option<String>;
| ^^^^^^^^^^^^^^^
|
type alias `ActorInformation` is never used:
src/sr/../api.rs#L56
warning: type alias `ActorInformation` is never used
--> src/sr/../api.rs:56:10
|
56 | pub type ActorInformation = fn(actor: &SActor) -> Option<String>;
| ^^^^^^^^^^^^^^^^
|
type alias `RoleInformation` is never used:
src/sr/../api.rs#L55
warning: type alias `RoleInformation` is never used
--> src/sr/../api.rs:55:10
|
55 | pub type RoleInformation = fn(role: &SRole) -> Option<String>;
| ^^^^^^^^^^^^^^^
|
type alias `ConfigLoaded` is never used:
src/sr/../api.rs#L37
warning: type alias `ConfigLoaded` is never used
--> src/sr/../api.rs:37:10
|
37 | pub type ConfigLoaded = fn(config: &SConfig);
| ^^^^^^^^^^^^
|
variant `Override` is never constructed:
src/sr/../api.rs#L26
warning: variant `Override` is never constructed
--> src/sr/../api.rs:26:5
|
25 | pub enum PluginResultAction {
| ------------------ variant in this enum
26 | Override, // The result of this plugin ends the algorithm to return the plugin result
| ^^^^^^^^
|
= note: `PluginResultAction` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
|
trait `Plugin` is never used:
src/sr/../api.rs#L19
warning: trait `Plugin` is never used
--> src/sr/../api.rs:19:11
|
19 | pub trait Plugin {
| ^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
constants have by default a `'static` lifetime:
src/chsr/../version.rs#L4
warning: constants have by default a `'static` lifetime
--> src/chsr/../version.rs:4:29
|
4 | pub const PACKAGE_VERSION: &'static str = "3.0.0-alpha.5";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
= note: `#[warn(clippy::redundant_static_lifetimes)]` on by default
|
this seems like a manual implementation of the non-exhaustive pattern:
src/chsr/../database/structs.rs#L31
warning: this seems like a manual implementation of the non-exhaustive pattern
--> src/chsr/../database/structs.rs:31:1
|
31 | pub struct SConfig {
| ^-----------------
| |
| _help: add the attribute: `#[non_exhaustive] pub struct SConfig`
| |
32 | | #[serde(skip_serializing_if = "Option::is_none")]
33 | | pub options: OptWrapper,
34 | | #[serde(default, skip_serializing_if = "Vec::is_empty")]
... |
40 | | pub _extra_fields: Map<String, Value>,
41 | | }
| |_^
|
help: remove this field
--> src/chsr/../database/structs.rs:37:5
|
37 | storage: (),
| ^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
= note: `#[warn(clippy::manual_non_exhaustive)]` on by default
|
constants have by default a `'static` lifetime:
src/sr/../version.rs#L4
warning: constants have by default a `'static` lifetime
--> src/sr/../version.rs:4:29
|
4 | pub const PACKAGE_VERSION: &'static str = "3.0.0-alpha.5";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
= note: `#[warn(clippy::redundant_static_lifetimes)]` on by default
|
this seems like a manual implementation of the non-exhaustive pattern:
src/sr/../database/structs.rs#L31
warning: this seems like a manual implementation of the non-exhaustive pattern
--> src/sr/../database/structs.rs:31:1
|
31 | pub struct SConfig {
| ^-----------------
| |
| _help: add the attribute: `#[non_exhaustive] pub struct SConfig`
| |
32 | | #[serde(skip_serializing_if = "Option::is_none")]
33 | | pub options: OptWrapper,
34 | | #[serde(default, skip_serializing_if = "Vec::is_empty")]
... |
40 | | pub _extra_fields: Map<String, Value>,
41 | | }
| |_^
|
help: remove this field
--> src/sr/../database/structs.rs:37:5
|
37 | storage: (),
| ^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
= note: `#[warn(clippy::manual_non_exhaustive)]` on by default
|
function `write_doc` is never used:
build.rs#L41
warning: function `write_doc` is never used
--> build.rs:41:4
|
41 | fn write_doc(f: &mut File) -> Result<(), Box<dyn Error>> {
| ^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
build
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|