Merge pull request #46 from LeChatP/develop #19
Annotations
119 warnings
current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`:
src/chsr/../mod.rs#L113
warning: current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`
--> src/chsr/../mod.rs:113:44
|
113 | let res = std::fs::File::create(p).inspect_err(|e| {
| ____________________________________________^
114 | | debug!(
115 | | "Error creating file without privilege, trying with privileges: {}",
116 | | e
117 | | );
118 | | });
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
|
this `if` has identical blocks:
src/chsr/../util.rs#L143
warning: this `if` has identical blocks
--> src/chsr/../util.rs:143:75
|
143 | if input.len() >= 2 && input.starts_with('"') && input.ends_with('"') {
| ___________________________________________________________________________^
144 | | remove_outer_quotes(&input[1..input.len() - 1])
145 | | } else if input.len() >= 2 && input.starts_with('\'') && input.ends_with('\'') {
| |_____^
|
note: same as this
--> src/chsr/../util.rs:145:84
|
145 | } else if input.len() >= 2 && input.starts_with('\'') && input.ends_with('\'') {
| ____________________________________________________________________________________^
146 | | remove_outer_quotes(&input[1..input.len() - 1])
147 | | } else {
| |_____^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
= note: `#[warn(clippy::if_same_then_else)]` on by default
|
single-character string constant used as pattern:
src/chsr/../util.rs#L139
warning: single-character string constant used as pattern
--> src/chsr/../util.rs:139:45
|
139 | remove_outer_quotes(s.as_ref()).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
|
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
|
unnecessary `if let` since only the `Some` variant of the iterator element is used:
src/sr/main.rs#L503
warning: unnecessary `if let` since only the `Some` variant of the iterator element is used
--> src/sr/main.rs:503:13
|
503 | for group in res {
| ^ --- help: try: `res.flatten()`
| _____________|
| |
504 | | if let Some(group) = group {
505 | | groups.push(group.gid.as_raw());
506 | | }
507 | | }
| |_____________^
|
help: ...and remove the `if let` statement in the for loop
--> src/sr/main.rs:504:17
|
504 | / if let Some(group) = group {
505 | | groups.push(group.gid.as_raw());
506 | | }
| |_________________^
= 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
|
returning the result of a `let` binding from a block:
src/sr/main.rs#L427
warning: returning the result of a `let` binding from a block
--> src/sr/main.rs:427:5
|
421 | / let user = Cred {
422 | | user,
423 | | groups,
424 | | tty,
425 | | ppid,
426 | | };
| |______- unnecessary `let` binding
427 | 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
|
421 ~
422 ~ Cred {
423 + user,
424 + groups,
425 + tty,
426 + ppid,
427 + }
|
|
current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`:
src/sr/main.rs#L316
warning: current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`
--> src/sr/main.rs:316:14
|
316 | .inspect_err(|e| {
| ______________^
317 | | error!("{}", e);
318 | | })
| |______________^
|
= 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#L278
warning: this loop could be written as a `for` loop
--> src/sr/main.rs:278:5
|
278 | 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
|
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
|
current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`:
src/sr/../mod.rs#L113
warning: current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`
--> src/sr/../mod.rs:113:44
|
113 | let res = std::fs::File::create(p).inspect_err(|e| {
| ____________________________________________^
114 | | debug!(
115 | | "Error creating file without privilege, trying with privileges: {}",
116 | | e
117 | | );
118 | | });
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
|
very complex type used. Consider factoring parts into `type` definitions:
src/chsr/../database/options.rs#L680
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
|
very complex type used. Consider factoring parts into `type` definitions:
src/chsr/../database/options.rs#L625
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
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/options.rs#L537
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
|
stripping a prefix manually:
src/chsr/../database/options.rs#L430
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>
|
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/options.rs#L399
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
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/options.rs#L379
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
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/options.rs#L264
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
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/options.rs#L213
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
|
this `if` has identical blocks:
src/sr/../util.rs#L143
warning: this `if` has identical blocks
--> src/sr/../util.rs:143:75
|
143 | if input.len() >= 2 && input.starts_with('"') && input.ends_with('"') {
| ___________________________________________________________________________^
144 | | remove_outer_quotes(&input[1..input.len() - 1])
145 | | } else if input.len() >= 2 && input.starts_with('\'') && input.ends_with('\'') {
| |_____^
|
note: same as this
--> src/sr/../util.rs:145:84
|
145 | } else if input.len() >= 2 && input.starts_with('\'') && input.ends_with('\'') {
| ____________________________________________________________________________________^
146 | | remove_outer_quotes(&input[1..input.len() - 1])
147 | | } else {
| |_____^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
= note: `#[warn(clippy::if_same_then_else)]` on by default
|
single-character string constant used as pattern:
src/sr/../util.rs#L139
warning: single-character string constant used as pattern
--> src/sr/../util.rs:139:45
|
139 | remove_outer_quotes(s.as_ref()).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
|
this `impl` can be derived:
src/chsr/../database/options.rs#L80
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
= help: remove the manual implementation...
help: ...and instead derive it
|
64 + #[derive(Default)]
65 | pub struct STimeout {
|
|
name `UID` contains a capitalized acronym:
src/chsr/../database/options.rs#L60
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
|
name `TTY` contains a capitalized acronym:
src/chsr/../database/options.rs#L59
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
|
name `PPID` contains a capitalized acronym:
src/chsr/../database/options.rs#L58
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
|
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/../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
= note: `#[warn(clippy::type_complexity)]` on by default
|
assigning the result of `Clone::clone()` may be inefficient:
src/chsr/../database/finder.rs#L611
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/chsr/../database/finder.rs:611:9
|
611 | 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#L610
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/chsr/../database/finder.rs:610:9
|
610 | 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
|
this `impl` can be derived:
src/chsr/../database/finder.rs#L297
warning: this `impl` can be derived
--> src/chsr/../database/finder.rs:297:1
|
297 | / impl Default for FilterMatcher {
298 | | fn default() -> Self {
299 | | FilterMatcher {
300 | | role: None,
... |
303 | | }
304 | | }
| |_^
|
= 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
|
292 + #[derive(Default)]
293 | pub struct FilterMatcher {
|
|
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#L246
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
|
very complex type used. Consider factoring parts into `type` definitions:
src/sr/../database/options.rs#L680
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/sr/../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
|
very complex type used. Consider factoring parts into `type` definitions:
src/sr/../database/options.rs#L625
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/sr/../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
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/options.rs#L537
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../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/sr/../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
|
stripping a prefix manually:
src/sr/../database/options.rs#L430
warning: stripping a prefix manually
--> src/sr/../database/options.rs:430:9
|
430 | &tzval[1..]
| ^^^^^^^^^^^
|
note: the prefix was tested here
--> src/sr/../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>
|
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/options.rs#L399
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../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/sr/../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
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/options.rs#L379
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../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/sr/../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
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/options.rs#L264
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../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/sr/../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
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/options.rs#L213
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../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/sr/../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
= note: `#[warn(clippy::field_reassign_with_default)]` on by default
|
name `JSON` contains a capitalized acronym:
src/chsr/../config.rs#L87
warning: name `JSON` contains a capitalized acronym
--> src/chsr/../config.rs:87:5
|
87 | 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#L77
warning: name `JSON` contains a capitalized acronym
--> src/chsr/../config.rs:77:5
|
77 | 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
|
this `impl` can be derived:
src/sr/../database/options.rs#L80
warning: this `impl` can be derived
--> src/sr/../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
= help: remove the manual implementation...
help: ...and instead derive it
|
64 + #[derive(Default)]
65 | pub struct STimeout {
|
|
name `UID` contains a capitalized acronym:
src/sr/../database/options.rs#L60
warning: name `UID` contains a capitalized acronym
--> src/sr/../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
|
name `TTY` contains a capitalized acronym:
src/sr/../database/options.rs#L59
warning: name `TTY` contains a capitalized acronym
--> src/sr/../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
|
name `PPID` contains a capitalized acronym:
src/sr/../database/options.rs#L58
warning: name `PPID` contains a capitalized acronym
--> src/sr/../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
|
called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`:
src/chsr/cli.rs#L1318
warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
--> src/chsr/cli.rs:1318:29
|
1318 | // ... opt.as_ref().borrow_mut().wildcard_denied.as_mut().map(|w| {
1319 | || ... w.retain(|c| !options_wildcard.contains(c));
1320 | || ... });
| ||________________________^- help: try: `if let Some(w) = opt.as_ref().borrow_mut().wildcard_denied.as_mut() { w.retain(|c| !options_wildcard.contains(c)); }`
| |________________________|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn
= note: `#[warn(clippy::option_map_unit_fn)]` on by default
|
calling `.extend(_.chars())`:
src/chsr/cli.rs#L1310
warning: calling `.extend(_.chars())`
--> src/chsr/cli.rs:1310:29
|
1310 | ... default_wildcard.extend(options_wildcard.chars());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `default_wildcard.push_str(&options_wildcard)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#string_extend_chars
= note: `#[warn(clippy::string_extend_chars)]` on by default
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/cli.rs#L1246
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/cli.rs:1246:21
|
1246 | env.default_behavior = EnvBehavior::Delete;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `common::database::options::SEnvOptions { default_behavior: EnvBehavior::Delete, keep: options_env.clone(), ..Default::default() }` and removing relevant reassignments
--> src/chsr/cli.rs:1245:21
|
1245 | 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
|
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
|
redundant pattern matching, consider using `is_some()`:
src/chsr/cli.rs#L1023
warning: redundant pattern matching, consider using `is_some()`
--> src/chsr/cli.rs:1023:32
|
1023 | if let Some(_) = cred_setgid {
| -------^^^^^^^-------------- help: try: `if cred_setgid.is_some()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
|
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
|
redundant pattern matching, consider using `is_some()`:
src/chsr/cli.rs#L1020
warning: redundant pattern matching, consider using `is_some()`
--> src/chsr/cli.rs:1020:32
|
1020 | if let Some(_) = cred_setuid {
| -------^^^^^^^-------------- help: try: `if cred_setuid.is_some()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
= note: `#[warn(clippy::redundant_pattern_matching)]` on by default
|
useless conversion to the same type: `&str`:
src/chsr/cli.rs#L931
warning: useless conversion to the same type: `&str`
--> src/chsr/cli.rs:931:65
|
931 | let task = borrow.task(&task_id).expect("Task do not exists".into());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"Task do not exists"`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
use of `expect` followed by a function call:
src/chsr/cli.rs#L931
warning: use of `expect` followed by a function call
--> src/chsr/cli.rs:931:58
|
931 | let task = borrow.task(&task_id).expect("Task do not exists".into());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| { panic!("{}", "Task do not exists".into().to_string()) })`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
= note: `#[warn(clippy::expect_fun_call)]` on by default
|
assigning the result of `Clone::clone()` may be inefficient:
src/sr/../database/finder.rs#L611
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/sr/../database/finder.rs:611:9
|
611 | 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#L610
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/sr/../database/finder.rs:610:9
|
610 | 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
|
unneeded `return` statement:
src/chsr/cli.rs#L757
warning: unneeded `return` statement
--> src/chsr/cli.rs:757:17
|
757 | / return match list_json(
758 | | rconfig,
759 | | role_id,
760 | | task_id,
... |
773 | | }
774 | | };
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
757 ~ match list_json(
758 + rconfig,
759 + role_id,
760 + task_id,
761 + options,
762 + options_type,
763 + task_type,
764 + role_type,
765 + ) {
766 + Ok(_) => {
767 + debug!("chsr list ok");
768 + Ok(false)
769 + }
770 + Err(e) => {
771 + debug!("chsr list err {:?}", e);
772 + Err(e)
773 + }
774 ~ }
|
|
this `impl` can be derived:
src/sr/../database/finder.rs#L297
warning: this `impl` can be derived
--> src/sr/../database/finder.rs:297:1
|
297 | / impl Default for FilterMatcher {
298 | | fn default() -> Self {
299 | | FilterMatcher {
300 | | role: None,
... |
303 | | }
304 | | }
| |_^
|
= 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
|
292 + #[derive(Default)]
293 | pub struct FilterMatcher {
|
|
this boolean expression can be simplified:
src/chsr/cli.rs#L567
warning: this boolean expression can be simplified
--> src/chsr/cli.rs:567:44
|
567 | if inputs.role_id.is_some() && !inputs.task_id.is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `inputs.task_id.is_none()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
= note: `#[warn(clippy::nonminimal_bool)]` on by default
|
all variants have the same postfix: `List`:
src/chsr/cli.rs#L189
warning: all variants have the same postfix: `List`
--> src/chsr/cli.rs:189:1
|
189 | / enum SetListType {
190 | | WhiteList,
191 | | BlackList,
192 | | CheckList,
193 | | }
| |_^
|
= 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
|
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#L246
warning: current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`
--> src/sr/../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
|
name `JSON` contains a capitalized acronym:
src/sr/../config.rs#L87
warning: name `JSON` contains a capitalized acronym
--> src/sr/../config.rs:87:5
|
87 | 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#L77
warning: name `JSON` contains a capitalized acronym
--> src/sr/../config.rs:77:5
|
77 | 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
|
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_string`, `from_group_id`, `from_group_vec_string`, and `from_group_vec_id` are never used:
src/chsr/../database/structs.rs#L637
warning: associated functions `from_user_id`, `from_group_string`, `from_group_id`, `from_group_vec_string`, 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 {
| ^^^^^^^^^^^^
...
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 {
| ^^^^^^^^^^^^^^^^^
|
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#L564
warning: methods `get_opt`, `calculate_path`, `calculate_filtered_env`, and `get_lowest_level` are never used
--> src/chsr/../database/options.rs:564:8
|
490 | impl OptStack {
| ------------- methods in this implementation
...
564 | fn get_opt(&self, level: Level) -> Option<Rc<RefCell<Opt>>> {
| ^^^^^^^
...
589 | fn calculate_path(&self) -> String {
| ^^^^^^^^^^^^^^
...
748 | pub fn calculate_filtered_env(&self) -> Result<LinkedHashSet<(String, String)>, String> {
| ^^^^^^^^^^^^^^^^^^^^^^
...
975 | fn get_lowest_level(&self) -> Level {
| ^^^^^^^^^^^^^^^^
|
function `check_env` is never used:
src/chsr/../database/options.rs#L475
warning: function `check_env` is never used
--> src/chsr/../database/options.rs:475:4
|
475 | fn check_env(key: &str, value: &str) -> bool {
| ^^^^^^^^^
|
function `tz_is_safe` is never used:
src/chsr/../database/options.rs#L427
warning: function `tz_is_safe` is never used
--> src/chsr/../database/options.rs:427:4
|
427 | fn tz_is_safe(tzval: &str) -> bool {
| ^^^^^^^^^^
|
associated function `new` is never used:
src/chsr/../database/options.rs#L377
warning: associated function `new` is never used
--> src/chsr/../database/options.rs:377:8
|
376 | impl SPathOptions {
| ----------------- associated function in this implementation
377 | 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#L151
warning: function `create_dir_all_with_privileges` is never used
--> src/chsr/../mod.rs:151:8
|
151 | 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#L138
warning: function `remove_with_privileges` is never used
--> src/chsr/../mod.rs:138:8
|
138 | 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#L93
warning: function `activates_no_new_privs` is never used
--> src/chsr/../mod.rs:93:8
|
93 | 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
|
function `underline` is never used:
src/sr/../util.rs#L174
warning: function `underline` is never used
--> src/sr/../util.rs:174:8
|
174 | pub fn underline<R>(error: &pest::error::Error<R>) -> String
| ^^^^^^^^^
|
function `start` is never used:
src/sr/../util.rs#L164
warning: function `start` is never used
--> src/sr/../util.rs:164:4
|
164 | fn start<R>(error: &pest::error::Error<R>) -> (usize, usize)
| ^^^^^
|
function `escape_parser_string_vec` is never used:
src/sr/../util.rs#L124
warning: function `escape_parser_string_vec` is never used
--> src/sr/../util.rs:124:8
|
124 | pub fn escape_parser_string_vec<S, I>(s: I) -> String
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
constant `RED` is never used:
src/sr/../util.rs#L13
warning: constant `RED` is never used
--> src/sr/../util.rs:13:11
|
13 | 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#L564
warning: methods `get_opt`, `get_lowest_level`, and `to_opt` are never used
--> src/sr/../database/options.rs:564:8
|
490 | impl OptStack {
| ------------- methods in this implementation
...
564 | fn get_opt(&self, level: Level) -> Option<Rc<RefCell<Opt>>> {
| ^^^^^^^
...
975 | fn get_lowest_level(&self) -> Level {
| ^^^^^^^^^^^^^^^^
...
985 | pub fn to_opt(&self) -> Opt {
| ^^^^^^
|
associated function `new` is never used:
src/sr/../database/options.rs#L377
warning: associated function `new` is never used
--> src/sr/../database/options.rs:377:8
|
376 | impl SPathOptions {
| ----------------- associated function in this implementation
377 | 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.4";
| -^^^^^^^---- 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.4";
| -^^^^^^^---- 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
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
github-pages
Expired
|
1.32 MB |
|