v3.0.0-alpha.4 #163
Annotations
3 errors and 24 warnings
the name `version` is defined multiple times:
src/chsr/../database/version.rs#L9
error[E0252]: the name `version` is defined multiple times
--> src/chsr/../database/version.rs:9:5
|
8 | use crate::common::version;
| ---------------------- previous import of the module `version` here
9 | use crate::common::version;
| ^^^^^^^^^^^^^^^^^^^^^^ `version` reimported here
|
= note: `version` must be defined only once in the type namespace of this module
|
the name `version` is defined multiple times:
src/sr/../database/version.rs#L9
error[E0252]: the name `version` is defined multiple times
--> src/sr/../database/version.rs:9:5
|
8 | use crate::common::version;
| ---------------------- previous import of the module `version` here
9 | use crate::common::version;
| ^^^^^^^^^^^^^^^^^^^^^^ `version` reimported here
|
= note: `version` must be defined only once in the type namespace of this module
|
build
Process completed with exit code 2.
|
unused import: `IntoEnumIterator`:
src/chsr/../database/options.rs#L10
warning: unused import: `IntoEnumIterator`
--> src/chsr/../database/options.rs:10:50
|
10 | use strum::{Display, EnumIs, EnumIter, FromRepr, IntoEnumIterator};
| ^^^^^^^^^^^^^^^^
|
unused import: `IntoEnumIterator`:
src/sr/../database/options.rs#L10
warning: unused import: `IntoEnumIterator`
--> src/sr/../database/options.rs:10:50
|
10 | use strum::{Display, EnumIs, EnumIter, FromRepr, IntoEnumIterator};
| ^^^^^^^^^^^^^^^^
|
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
|
unused import: `crate::common::version`:
src/chsr/../database/version.rs#L9
warning: unused import: `crate::common::version`
--> src/chsr/../database/version.rs:9:5
|
9 | use crate::common::version;
| ^^^^^^^^^^^^^^^^^^^^^^
|
this `else { if .. }` block can be collapsed:
src/chsr/../database/structs.rs#L600
warning: this `else { if .. }` block can be collapsed
--> src/chsr/../database/structs.rs:600:24
|
600 | } else {
| ________________________^
601 | | if other.iter().all(|x| groups.iter().any(|y| y == x)) {
602 | | return Some(Ordering::Greater);
603 | | }
604 | | }
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
help: collapse nested if block
|
600 ~ } else if other.iter().all(|x| groups.iter().any(|y| y == x)) {
601 + return Some(Ordering::Greater);
602 + }
|
|
this `else { if .. }` block can be collapsed:
src/chsr/../database/structs.rs#L585
warning: this `else { if .. }` block can be collapsed
--> src/chsr/../database/structs.rs:585:24
|
585 | } else {
| ________________________^
586 | | if other.iter().any(|x| group == x) {
587 | | return Some(Ordering::Less);
588 | | }
589 | | }
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
help: collapse nested if block
|
585 ~ } else if other.iter().any(|x| group == x) {
586 + return Some(Ordering::Less);
587 + }
|
|
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
|
this `else { if .. }` block can be collapsed:
src/chsr/../database/finder.rs#L516
warning: this `else { if .. }` block can be collapsed
--> src/chsr/../database/finder.rs:516:24
|
516 | } else {
| ________________________^
517 | | if groups_contains_root(setgid) {
518 | | SetuidMin::SetuidNotrootSetgidRoot(groups_len(setgid))
519 | | } else if setgid.is_none() || groups_len(setgid) == 0 {
... |
523 | | }
524 | | }
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
help: collapse nested if block
|
516 ~ } else if groups_contains_root(setgid) {
517 + SetuidMin::SetuidNotrootSetgidRoot(groups_len(setgid))
518 + } else if setgid.is_none() || groups_len(setgid) == 0 {
519 + SetuidMin::Setuid
520 + } else {
521 + SetuidMin::SetuidSetgid(groups_len(setgid))
522 + }
|
|
this `else { if .. }` block can be collapsed:
src/chsr/../database/finder.rs#L330
warning: this `else { if .. }` block can be collapsed
--> src/chsr/../database/finder.rs:330:12
|
330 | } else {
| ____________^
331 | | if let Some(env_path) = find_from_envpath(&path.parse().expect("The path is not valid")) {
332 | | result = env_path
333 | | } else {
334 | | result = path.parse().expect("The path is not valid");
335 | | }
336 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
help: collapse nested if block
|
330 ~ } else if let Some(env_path) = find_from_envpath(&path.parse().expect("The path is not valid")) {
331 + result = env_path
332 + } else {
333 + result = path.parse().expect("The path is not valid");
334 + }
|
|
unused import: `tracing::warn`:
src/chsr/../database/mod.rs#L11
warning: unused import: `tracing::warn`
--> src/chsr/../database/mod.rs:11:5
|
11 | use tracing::warn;
| ^^^^^^^^^^^^^
|
unused import: `crate::rc_refcell`:
src/chsr/../database/mod.rs#L6
warning: unused import: `crate::rc_refcell`
--> src/chsr/../database/mod.rs:6:5
|
6 | use crate::rc_refcell;
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
this `else { if .. }` block can be collapsed:
src/chsr/cli.rs#L1355
warning: this `else { if .. }` block can be collapsed
--> src/chsr/cli.rs:1355:12
|
1355 | } else {
| ____________^
1356 | | if options {
1357 | | println!(
1358 | | "{}",
... |
1363 | | }
1364 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
help: collapse nested if block
|
1355 ~ } else if options {
1356 + println!(
1357 + "{}",
1358 + serde_json::to_string_pretty(&OptStack::from_role(role.clone()).to_opt())?
1359 + );
1360 + } else {
1361 + print_role(&role, &role_type.unwrap_or(RoleType::All));
1362 + }
|
|
this `else { if .. }` block can be collapsed:
src/chsr/cli.rs#L1270
warning: this `else { if .. }` block can be collapsed
--> src/chsr/cli.rs:1270:20
|
1270 | } else {
| ____________________^
1271 | | if let Some(options) = &role.as_ref().borrow_mut().options {
1272 | | return exec_on_opt(options.clone());
1273 | | } else {
... |
1278 | | }
1279 | | }
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
= note: `#[warn(clippy::collapsible_else_if)]` on by default
help: collapse nested if block
|
1270 ~ } else if let Some(options) = &role.as_ref().borrow_mut().options {
1271 + return exec_on_opt(options.clone());
1272 + } else {
1273 + let options = Rc::new(RefCell::new(Opt::default()));
1274 + let ret = exec_on_opt(options.clone());
1275 + role.as_ref().borrow_mut().options = Some(options);
1276 + return ret;
1277 + }
|
|
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
|
unused import: `crate::common::version`:
src/sr/../database/version.rs#L9
warning: unused import: `crate::common::version`
--> src/sr/../database/version.rs:9:5
|
9 | use crate::common::version;
| ^^^^^^^^^^^^^^^^^^^^^^
|
this `else { if .. }` block can be collapsed:
src/sr/../database/structs.rs#L600
warning: this `else { if .. }` block can be collapsed
--> src/sr/../database/structs.rs:600:24
|
600 | } else {
| ________________________^
601 | | if other.iter().all(|x| groups.iter().any(|y| y == x)) {
602 | | return Some(Ordering::Greater);
603 | | }
604 | | }
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
help: collapse nested if block
|
600 ~ } else if other.iter().all(|x| groups.iter().any(|y| y == x)) {
601 + return Some(Ordering::Greater);
602 + }
|
|
this `else { if .. }` block can be collapsed:
src/sr/../database/structs.rs#L585
warning: this `else { if .. }` block can be collapsed
--> src/sr/../database/structs.rs:585:24
|
585 | } else {
| ________________________^
586 | | if other.iter().any(|x| group == x) {
587 | | return Some(Ordering::Less);
588 | | }
589 | | }
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
help: collapse nested if block
|
585 ~ } else if other.iter().any(|x| group == x) {
586 + return Some(Ordering::Less);
587 + }
|
|
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
|
this `else { if .. }` block can be collapsed:
src/sr/../database/finder.rs#L516
warning: this `else { if .. }` block can be collapsed
--> src/sr/../database/finder.rs:516:24
|
516 | } else {
| ________________________^
517 | | if groups_contains_root(setgid) {
518 | | SetuidMin::SetuidNotrootSetgidRoot(groups_len(setgid))
519 | | } else if setgid.is_none() || groups_len(setgid) == 0 {
... |
523 | | }
524 | | }
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
help: collapse nested if block
|
516 ~ } else if groups_contains_root(setgid) {
517 + SetuidMin::SetuidNotrootSetgidRoot(groups_len(setgid))
518 + } else if setgid.is_none() || groups_len(setgid) == 0 {
519 + SetuidMin::Setuid
520 + } else {
521 + SetuidMin::SetuidSetgid(groups_len(setgid))
522 + }
|
|
this `else { if .. }` block can be collapsed:
src/sr/../database/finder.rs#L330
warning: this `else { if .. }` block can be collapsed
--> src/sr/../database/finder.rs:330:12
|
330 | } else {
| ____________^
331 | | if let Some(env_path) = find_from_envpath(&path.parse().expect("The path is not valid")) {
332 | | result = env_path
333 | | } else {
334 | | result = path.parse().expect("The path is not valid");
335 | | }
336 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
= note: `#[warn(clippy::collapsible_else_if)]` on by default
help: collapse nested if block
|
330 ~ } else if let Some(env_path) = find_from_envpath(&path.parse().expect("The path is not valid")) {
331 + result = env_path
332 + } else {
333 + result = path.parse().expect("The path is not valid");
334 + }
|
|
unused import: `tracing::warn`:
src/sr/../database/mod.rs#L11
warning: unused import: `tracing::warn`
--> src/sr/../database/mod.rs:11:5
|
11 | use tracing::warn;
| ^^^^^^^^^^^^^
|
unused import: `crate::rc_refcell`:
src/sr/../database/mod.rs#L6
warning: unused import: `crate::rc_refcell`
--> src/sr/../database/mod.rs:6:5
|
6 | use crate::rc_refcell;
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent:
build.rs#L118
warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent
--> build.rs:118:25
|
118 | let mut s = line.split("(V").nth(0).unwrap().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `line.split("(V").next()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
= note: `#[warn(clippy::iter_nth_zero)]` 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/.
|