well rust coverage is dash #198
Annotations
109 warnings
single-character string constant used as pattern:
src/chsr/../util.rs#L127
warning: single-character string constant used as pattern
--> src/chsr/../util.rs:127:45
|
127 | format!("\"{}\"", s.replace("\"", "\\\""))
| ^^^^ help: consider using a `char`: `'"'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
= note: `#[warn(clippy::single_char_pattern)]` on by default
|
methods called `into_*` usually take `self` by value:
src/chsr/../database/structs.rs#L555
warning: methods called `into_*` usually take `self` by value
--> src/chsr/../database/structs.rs:555:22
|
555 | pub fn into_user(&self) -> Result<Option<User>, Errno> {
| ^^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
|
methods called `into_*` usually take `self` by value:
src/chsr/../database/structs.rs#L549
warning: methods called `into_*` usually take `self` by value
--> src/chsr/../database/structs.rs:549:23
|
549 | pub fn into_group(&self) -> Result<Option<Group>, Errno> {
| ^^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
= note: `#[warn(clippy::wrong_self_convention)]` on by default
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/structs.rs#L392
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/../database/structs.rs:392:9
|
392 | ret.name = name;
| ^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `common::database::structs::STask { name: name, _role: Some(role), ..Default::default() }` and removing relevant reassignments
--> src/chsr/../database/structs.rs:391:9
|
391 | let mut ret = STask::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/structs.rs#L375
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/../database/structs.rs:375:9
|
375 | ret.name = name;
| ^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `common::database::structs::SRole { name: name, _config: Some(config), ..Default::default() }` and removing relevant reassignments
--> src/chsr/../database/structs.rs:374:9
|
374 | let mut ret = SRole::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/../database/structs.rs#L310
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/../database/structs.rs:310:9
|
310 | c.add = capset;
| ^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `common::database::structs::SCapabilities { add: capset, ..Default::default() }` and removing relevant reassignments
--> src/chsr/../database/structs.rs:309:9
|
309 | let mut c = SCapabilities::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
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 `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
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it
|
64 + #[derive(Default)]
65 | pub struct STimeout {
|
|
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
|
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#L546
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/chsr/../database/finder.rs:546:9
|
546 | settings.setgroups = setgid.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `settings.setgroups.clone_from(setgid)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
|
assigning the result of `Clone::clone()` may be inefficient:
src/chsr/../database/finder.rs#L545
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/chsr/../database/finder.rs:545:9
|
545 | settings.setuid = setuid.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `settings.setuid.clone_from(setuid)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note: `#[warn(clippy::assigning_clones)]` on by default
|
all variants have the same postfix: `Match`:
src/chsr/../database/finder.rs#L99
warning: all variants have the same postfix: `Match`
--> src/chsr/../database/finder.rs:99:1
|
99 | / pub enum UserMin {
100 | | UserMatch,
101 | | GroupMatch(usize),
102 | | NoMatch,
103 | | }
| |_^
|
= help: remove the postfixes and use full paths to the variants instead of glob imports
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
|
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
|
unnecessary `if let` since only the `Some` variant of the iterator element is used:
src/sr/main.rs#L412
warning: unnecessary `if let` since only the `Some` variant of the iterator element is used
--> src/sr/main.rs:412:13
|
412 | for group in res {
| ^ --- help: try: `res.flatten()`
| _____________|
| |
413 | | if let Some(group) = group {
414 | | groups.push(group.gid.as_raw());
415 | | }
416 | | }
| |_____________^
|
help: ...and remove the `if let` statement in the for loop
--> src/sr/main.rs:413:17
|
413 | / if let Some(group) = group {
414 | | groups.push(group.gid.as_raw());
415 | | }
| |_________________^
= 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#L342
warning: returning the result of a `let` binding from a block
--> src/sr/main.rs:342:5
|
336 | / let user = Cred {
337 | | user,
338 | | groups,
339 | | tty,
340 | | ppid,
341 | | };
| |______- unnecessary `let` binding
342 | 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
|
336 ~
337 ~ Cred {
338 + user,
339 + groups,
340 + tty,
341 + ppid,
342 + }
|
|
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
|
called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`:
src/chsr/cli.rs#L1413
warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
--> src/chsr/cli.rs:1413:29
|
1413 | // ... opt.as_ref().borrow_mut().wildcard_denied.as_mut().map(|w| {
1414 | || ... w.retain(|c| !options_wildcard.contains(c));
1415 | || ... });
| ||________________________^- 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#L1405
warning: calling `.extend(_.chars())`
--> src/chsr/cli.rs:1405:29
|
1405 | ... 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#L1342
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/cli.rs:1342:21
|
1342 | 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:1341:21
|
1341 | 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
|
redundant pattern matching, consider using `is_some()`:
src/chsr/cli.rs#L1083
warning: redundant pattern matching, consider using `is_some()`
--> src/chsr/cli.rs:1083:32
|
1083 | 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
|
redundant pattern matching, consider using `is_some()`:
src/chsr/cli.rs#L1080
warning: redundant pattern matching, consider using `is_some()`
--> src/chsr/cli.rs:1080:32
|
1080 | 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#L991
warning: useless conversion to the same type: `&str`
--> src/chsr/cli.rs:991:65
|
991 | 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#L991
warning: use of `expect` followed by a function call
--> src/chsr/cli.rs:991:58
|
991 | 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
|
name `PPID` contains a capitalized acronym:
src/sr/timeout.rs#L39
warning: name `PPID` contains a capitalized acronym
--> src/sr/timeout.rs:39:5
|
39 | 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#L38
warning: name `TTY` contains a capitalized acronym
--> src/sr/timeout.rs:38:5
|
38 | 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
|
unneeded `return` statement:
src/chsr/cli.rs#L817
warning: unneeded `return` statement
--> src/chsr/cli.rs:817:17
|
817 | / return match list_json(
818 | | rconfig,
819 | | role_id,
820 | | task_id,
... |
833 | | }
834 | | };
| |_________________^
|
= 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`
|
817 ~ match list_json(
818 + rconfig,
819 + role_id,
820 + task_id,
821 + options,
822 + options_type,
823 + task_type,
824 + role_type,
825 + ) {
826 + Ok(_) => {
827 + debug!("chsr list ok");
828 + Ok(false)
829 + }
830 + Err(e) => {
831 + debug!("chsr list err {:?}", e);
832 + Err(e)
833 + }
834 ~ }
|
|
this boolean expression can be simplified:
src/chsr/cli.rs#L572
warning: this boolean expression can be simplified
--> src/chsr/cli.rs:572:44
|
572 | 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
|
single-character string constant used as pattern:
src/sr/../util.rs#L127
warning: single-character string constant used as pattern
--> src/sr/../util.rs:127:45
|
127 | format!("\"{}\"", s.replace("\"", "\\\""))
| ^^^^ help: consider using a `char`: `'"'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
= note: `#[warn(clippy::single_char_pattern)]` on by default
|
all variants have the same postfix: `List`:
src/chsr/cli.rs#L195
warning: all variants have the same postfix: `List`
--> src/chsr/cli.rs:195:1
|
195 | / enum SetListType {
196 | | WhiteList,
197 | | BlackList,
198 | | CheckList,
199 | | }
| |_^
|
= 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
|
methods called `into_*` usually take `self` by value:
src/sr/../database/structs.rs#L555
warning: methods called `into_*` usually take `self` by value
--> src/sr/../database/structs.rs:555:22
|
555 | pub fn into_user(&self) -> Result<Option<User>, Errno> {
| ^^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
|
methods called `into_*` usually take `self` by value:
src/sr/../database/structs.rs#L549
warning: methods called `into_*` usually take `self` by value
--> src/sr/../database/structs.rs:549:23
|
549 | pub fn into_group(&self) -> Result<Option<Group>, Errno> {
| ^^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
= note: `#[warn(clippy::wrong_self_convention)]` on by default
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/structs.rs#L392
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../database/structs.rs:392:9
|
392 | ret.name = name;
| ^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `common::database::structs::STask { name: name, _role: Some(role), ..Default::default() }` and removing relevant reassignments
--> src/sr/../database/structs.rs:391:9
|
391 | let mut ret = STask::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/structs.rs#L375
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../database/structs.rs:375:9
|
375 | ret.name = name;
| ^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `common::database::structs::SRole { name: name, _config: Some(config), ..Default::default() }` and removing relevant reassignments
--> src/sr/../database/structs.rs:374:9
|
374 | let mut ret = SRole::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/sr/../database/structs.rs#L310
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/sr/../database/structs.rs:310:9
|
310 | c.add = capset;
| ^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `common::database::structs::SCapabilities { add: capset, ..Default::default() }` and removing relevant reassignments
--> src/sr/../database/structs.rs:309:9
|
309 | let mut c = SCapabilities::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
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#L619
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:619:12
|
612 | impl SActor {
| ----------- associated functions in this implementation
...
619 | pub fn from_user_id(id: u32) -> Self {
| ^^^^^^^^^^^^
...
625 | pub fn from_group_string(group: &str) -> Self {
| ^^^^^^^^^^^^^^^^^
...
631 | pub fn from_group_id(id: u32) -> Self {
| ^^^^^^^^^^^^^
...
637 | pub fn from_group_vec_string(group: Vec<&str>) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^
...
645 | pub fn from_group_vec_id(groups: Vec<u32>) -> Self {
| ^^^^^^^^^^^^^^^^^
|
method `config` is never used:
src/chsr/../database/structs.rs#L379
warning: method `config` is never used
--> src/chsr/../database/structs.rs:379:12
|
372 | impl SRole {
| ---------- method in this implementation
...
379 | pub fn config(&self) -> Option<Rc<RefCell<SConfig>>> {
| ^^^^^^
|
multiple methods are never used:
src/chsr/../database/options.rs#L564
warning: multiple methods 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>>> {
| ^^^^^^^
...
568 | fn find_in_options<F: Fn(&Opt) -> Option<(Level, V)>, V>(&self, f: F) -> Option<(Level, V)> {
| ^^^^^^^^^^^^^^^
...
589 | fn calculate_path(&self) -> String {
| ^^^^^^^^^^^^^^
...
748 | pub fn calculate_filtered_env(&self) -> Result<LinkedHashSet<(String, String)>, String> {
| ^^^^^^^^^^^^^^^^^^^^^^
...
937 | pub fn get_root_behavior(&self) -> (Level, SPrivileged) {
| ^^^^^^^^^^^^^^^^^
...
946 | pub fn get_bounding(&self) -> (Level, SBounding) {
| ^^^^^^^^^^^^
...
955 | pub fn get_wildcard(&self) -> (Level, String) {
| ^^^^^^^^^^^^
...
965 | pub fn get_timeout(&self) -> (Level, STimeout) {
| ^^^^^^^^^^^
...
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 {
| ^^^
|
variant `None` is never constructed:
src/chsr/../database/options.rs#L24
warning: variant `None` is never constructed
--> src/chsr/../database/options.rs:24:5
|
23 | pub enum Level {
| ----- variant in this enum
24 | None,
| ^^^^
|
= note: `Level` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
|
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#L101
warning: multiple associated functions are never used
--> src/chsr/../api.rs:101:12
|
83 | impl PluginManager {
| ------------------ associated functions in this implementation
...
101 | pub fn subscribe_task_matcher(plugin: TaskMatcher) {
| ^^^^^^^^^^^^^^^^^^^^^^
...
105 | pub fn subscribe_user_matcher(plugin: UserMatcher) {
| ^^^^^^^^^^^^^^^^^^^^^^
...
113 | pub fn subscribe_task_separation(plugin: TaskSeparation) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
...
117 | pub fn subscribe_caps_filter(plugin: CapsFilter) {
| ^^^^^^^^^^^^^^^^^^^^^
...
121 | pub fn subscribe_privilege_checker(plugin: ExecutionChecker) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
149 | pub fn notify_task_matcher(
| ^^^^^^^^^^^^^^^^^^^
...
188 | pub fn notify_task_separation(task: &STask, actor: &Cred) -> PluginResult {
| ^^^^^^^^^^^^^^^^^^^^^^
...
199 | pub fn notify_caps_filter(task: &STask, capabilities: &mut CapSet) -> PluginResultAction {
| ^^^^^^^^^^^^^^^^^^
...
211 | 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#L74
warning: fields `task_matcher_plugins`, `task_separation_plugins`, `caps_filter_plugins`, and `execution_checker_plugins` are never read
--> src/chsr/../api.rs:74:5
|
72 | pub struct PluginManager {
| ------------- fields in this struct
73 | role_matcher_plugins: Vec<RoleMatcher>,
74 | task_matcher_plugins: Vec<TaskMatcher>,
| ^^^^^^^^^^^^^^^^^^^^
...
77 | task_separation_plugins: Vec<TaskSeparation>,
| ^^^^^^^^^^^^^^^^^^^^^^^
78 | caps_filter_plugins: Vec<CapsFilter>,
| ^^^^^^^^^^^^^^^^^^^
79 | execution_checker_plugins: Vec<ExecutionChecker>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
type alias `TaskInformation` is never used:
src/chsr/../api.rs#L53
warning: type alias `TaskInformation` is never used
--> src/chsr/../api.rs:53:10
|
53 | pub type TaskInformation = fn(task: &STask) -> Option<String>;
| ^^^^^^^^^^^^^^^
|
type alias `ActorInformation` is never used:
src/chsr/../api.rs#L52
warning: type alias `ActorInformation` is never used
--> src/chsr/../api.rs:52:10
|
52 | pub type ActorInformation = fn(actor: &SActor) -> Option<String>;
| ^^^^^^^^^^^^^^^^
|
type alias `RoleInformation` is never used:
src/chsr/../api.rs#L51
warning: type alias `RoleInformation` is never used
--> src/chsr/../api.rs:51:10
|
51 | pub type RoleInformation = fn(role: &SRole) -> Option<String>;
| ^^^^^^^^^^^^^^^
|
type alias `ConfigLoaded` is never used:
src/chsr/../api.rs#L34
warning: type alias `ConfigLoaded` is never used
--> src/chsr/../api.rs:34:10
|
34 | pub type ConfigLoaded = fn(config: &SConfig);
| ^^^^^^^^^^^^
|
variant `Override` is never constructed:
src/chsr/../api.rs#L23
warning: variant `Override` is never constructed
--> src/chsr/../api.rs:23:5
|
22 | pub enum PluginResultAction {
| ------------------ variant in this enum
23 | 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#L16
warning: trait `Plugin` is never used
--> src/chsr/../api.rs:16:11
|
16 | pub trait Plugin {
| ^^^^^^
|
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
|
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
|
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
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it
|
64 + #[derive(Default)]
65 | pub struct STimeout {
|
|
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
|
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#L546
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/sr/../database/finder.rs:546:9
|
546 | settings.setgroups = setgid.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `settings.setgroups.clone_from(setgid)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
|
assigning the result of `Clone::clone()` may be inefficient:
src/sr/../database/finder.rs#L545
warning: assigning the result of `Clone::clone()` may be inefficient
--> src/sr/../database/finder.rs:545:9
|
545 | settings.setuid = setuid.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `settings.setuid.clone_from(setuid)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note: `#[warn(clippy::assigning_clones)]` on by default
|
all variants have the same postfix: `Match`:
src/sr/../database/finder.rs#L99
warning: all variants have the same postfix: `Match`
--> src/sr/../database/finder.rs:99:1
|
99 | / pub enum UserMin {
100 | | UserMatch,
101 | | GroupMatch(usize),
102 | | NoMatch,
103 | | }
| |_^
|
= help: remove the postfixes and use full paths to the variants instead of glob imports
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
= 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
|
unused variable: `e`:
src/chsr/../api.rs#L229
warning: unused variable: `e`
--> src/chsr/../api.rs:229:21
|
229 | Err(e) => {
| ^ help: if this is intentional, prefix it with an underscore: `_e`
|
= note: `#[warn(unused_variables)]` 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
|
function `escape_parser_string` is never used:
src/sr/../util.rs#L118
warning: function `escape_parser_string` is never used
--> src/sr/../util.rs:118:8
|
118 | pub fn escape_parser_string<S, I>(s: I) -> String
| ^^^^^^^^^^^^^^^^^^^^
|
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#L613
warning: multiple associated functions are never used
--> src/sr/../database/structs.rs:613:12
|
612 | impl SActor {
| ----------- associated functions in this implementation
613 | pub fn from_user_string(user: &str) -> Self {
| ^^^^^^^^^^^^^^^^
...
619 | pub fn from_user_id(id: u32) -> Self {
| ^^^^^^^^^^^^
...
625 | pub fn from_group_string(group: &str) -> Self {
| ^^^^^^^^^^^^^^^^^
...
631 | pub fn from_group_id(id: u32) -> Self {
| ^^^^^^^^^^^^^
...
637 | pub fn from_group_vec_string(group: Vec<&str>) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^
...
645 | pub fn from_group_vec_id(groups: Vec<u32>) -> Self {
| ^^^^^^^^^^^^^^^^^
...
653 | pub fn from_group_vec_actors(groups: Vec<SActorType>) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^
|
associated function `new` is never used:
src/sr/../database/structs.rs#L390
warning: associated function `new` is never used
--> src/sr/../database/structs.rs:390:12
|
389 | impl STask {
| ---------- associated function in this implementation
390 | pub fn new(name: IdTask, role: Weak<RefCell<SRole>>) -> Self {
| ^^^
|
associated items `new` and `config` are never used:
src/sr/../database/structs.rs#L373
warning: associated items `new` and `config` are never used
--> src/sr/../database/structs.rs:373:12
|
372 | impl SRole {
| ---------- associated items in this implementation
373 | pub fn new(name: String, config: Weak<RefCell<SConfig>>) -> Self {
| ^^^
...
379 | pub fn config(&self) -> Option<Rc<RefCell<SConfig>>> {
| ^^^^^^
|
methods `get_opt`, `get_wildcard`, `get_lowest_level`, and `to_opt` are never used:
src/sr/../database/options.rs#L564
warning: methods `get_opt`, `get_wildcard`, `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>>> {
| ^^^^^^^
...
955 | pub fn get_wildcard(&self) -> (Level, String) {
| ^^^^^^^^^^^^
...
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#L101
warning: multiple associated functions are never used
--> src/sr/../api.rs:101:12
|
83 | impl PluginManager {
| ------------------ associated functions in this implementation
...
101 | pub fn subscribe_task_matcher(plugin: TaskMatcher) {
| ^^^^^^^^^^^^^^^^^^^^^^
...
105 | pub fn subscribe_user_matcher(plugin: UserMatcher) {
| ^^^^^^^^^^^^^^^^^^^^^^
...
113 | pub fn subscribe_task_separation(plugin: TaskSeparation) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
...
117 | pub fn subscribe_caps_filter(plugin: CapsFilter) {
| ^^^^^^^^^^^^^^^^^^^^^
...
121 | pub fn subscribe_privilege_checker(plugin: ExecutionChecker) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
149 | pub fn notify_task_matcher(
| ^^^^^^^^^^^^^^^^^^^
...
188 | pub fn notify_task_separation(task: &STask, actor: &Cred) -> PluginResult {
| ^^^^^^^^^^^^^^^^^^^^^^
...
199 | pub fn notify_caps_filter(task: &STask, capabilities: &mut CapSet) -> PluginResultAction {
| ^^^^^^^^^^^^^^^^^^
...
211 | 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#L74
warning: fields `task_matcher_plugins`, `task_separation_plugins`, `caps_filter_plugins`, and `execution_checker_plugins` are never read
--> src/sr/../api.rs:74:5
|
72 | pub struct PluginManager {
| ------------- fields in this struct
73 | role_matcher_plugins: Vec<RoleMatcher>,
74 | task_matcher_plugins: Vec<TaskMatcher>,
| ^^^^^^^^^^^^^^^^^^^^
...
77 | task_separation_plugins: Vec<TaskSeparation>,
| ^^^^^^^^^^^^^^^^^^^^^^^
78 | caps_filter_plugins: Vec<CapsFilter>,
| ^^^^^^^^^^^^^^^^^^^
79 | execution_checker_plugins: Vec<ExecutionChecker>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
type alias `TaskInformation` is never used:
src/sr/../api.rs#L53
warning: type alias `TaskInformation` is never used
--> src/sr/../api.rs:53:10
|
53 | pub type TaskInformation = fn(task: &STask) -> Option<String>;
| ^^^^^^^^^^^^^^^
|
type alias `ActorInformation` is never used:
src/sr/../api.rs#L52
warning: type alias `ActorInformation` is never used
--> src/sr/../api.rs:52:10
|
52 | pub type ActorInformation = fn(actor: &SActor) -> Option<String>;
| ^^^^^^^^^^^^^^^^
|
type alias `RoleInformation` is never used:
src/sr/../api.rs#L51
warning: type alias `RoleInformation` is never used
--> src/sr/../api.rs:51:10
|
51 | pub type RoleInformation = fn(role: &SRole) -> Option<String>;
| ^^^^^^^^^^^^^^^
|
type alias `ConfigLoaded` is never used:
src/sr/../api.rs#L34
warning: type alias `ConfigLoaded` is never used
--> src/sr/../api.rs:34:10
|
34 | pub type ConfigLoaded = fn(config: &SConfig);
| ^^^^^^^^^^^^
|
variant `Override` is never constructed:
src/sr/../api.rs#L23
warning: variant `Override` is never constructed
--> src/sr/../api.rs:23:5
|
22 | pub enum PluginResultAction {
| ------------------ variant in this enum
23 | 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#L16
warning: trait `Plugin` is never used
--> src/sr/../api.rs:16:11
|
16 | pub trait Plugin {
| ^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
unused variable: `e`:
src/sr/../api.rs#L229
warning: unused variable: `e`
--> src/sr/../api.rs:229:21
|
229 | Err(e) => {
| ^ help: if this is intentional, prefix it with an underscore: `_e`
|
= note: `#[warn(unused_variables)]` 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
|
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/.
|