cargo fmt #198
Annotations
54 warnings
field assignment outside of initializer for an instance created with Default::default():
src/chsr/cli/process/json.rs#L888
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/cli/process/json.rs:888:13
|
888 | path.default_behavior = options_path_policy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `rar_common::database::options::SPathOptions { default_behavior: options_path_policy, ..Default::default() }` and removing relevant reassignments
--> src/chsr/cli/process/json.rs:887:13
|
887 | let mut path = SPathOptions::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
field assignment outside of initializer for an instance created with Default::default():
src/chsr/cli/process/json.rs#L610
warning: field assignment outside of initializer for an instance created with Default::default()
--> src/chsr/cli/process/json.rs:610:9
|
610 | env.default_behavior = options_env_policy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `rar_common::database::options::SEnvOptions { default_behavior: options_env_policy, ..Default::default() }` and removing relevant reassignments
--> src/chsr/cli/process/json.rs:609:9
|
609 | 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/chsr/cli/pair.rs#L22
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/chsr/cli/pair.rs:22:18
|
22 | do_matching: &dyn Fn(&Pair<Rule>, &mut Inputs) -> Result<(), Box<dyn Error>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `#[warn(clippy::type_complexity)]` on by default
|
all variants have the same postfix: `List`:
src/chsr/cli/data.rs#L46
warning: all variants have the same postfix: `List`
--> src/chsr/cli/data.rs:46:1
|
46 | / pub enum SetListType {
47 | | WhiteList,
48 | | BlackList,
49 | | CheckList,
50 | | SetList,
51 | | }
| |_^
|
= help: remove the postfixes and use full paths to the variants instead of glob imports
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
= note: `#[warn(clippy::enum_variant_names)]` on by default
|
unnecessary `if let` since only the `Some` variant of the iterator element is used:
src/sr/main.rs#L405
warning: unnecessary `if let` since only the `Some` variant of the iterator element is used
--> src/sr/main.rs:405:13
|
405 | for group in res {
| ^ --- help: try: `res.flatten()`
| _____________|
| |
406 | | if let Some(group) = group {
407 | | groups.push(group.gid.as_raw());
408 | | }
409 | | }
| |_____________^
|
help: ...and remove the `if let` statement in the for loop
--> src/sr/main.rs:406:17
|
406 | / if let Some(group) = group {
407 | | groups.push(group.gid.as_raw());
408 | | }
| |_________________^
= 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#L329
warning: returning the result of a `let` binding from a block
--> src/sr/main.rs:329:5
|
323 | / let user = Cred {
324 | | user,
325 | | groups,
326 | | tty,
327 | | ppid,
328 | | };
| |______- unnecessary `let` binding
329 | 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
|
323 ~
324 ~ Cred {
325 + user,
326 + groups,
327 + tty,
328 + ppid,
329 + }
|
|
`to_string` applied to a type that implements `Display` in `eprintln!` args:
src/sr/main.rs#L284
warning: `to_string` applied to a type that implements `Display` in `eprintln!` args
--> src/sr/main.rs:284:68
|
284 | eprintln!("sr: {} : {}", execcfg.exec_path.display(), e.to_string());
| ^^^^^^^^^^^^ help: remove this
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
= note: `#[warn(clippy::to_string_in_format_args)]` on by default
|
current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`:
src/sr/main.rs#L219
warning: current MSRV (Minimum Supported Rust Version) is `1.74.1` but this item is stable since `1.76.0`
--> src/sr/main.rs:219:14
|
219 | .inspect_err(|e| {
| ______________^
220 | | error!("{}", e);
221 | | })
| |______________^
|
= 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
|
this loop could be written as a `for` loop:
src/sr/main.rs#L182
warning: this loop could be written as a `for` loop
--> src/sr/main.rs:182:5
|
182 | while let Some(arg) = iter.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for arg in iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator
= note: `#[warn(clippy::while_let_on_iterator)]` on by default
|
the borrowed expression implements the required traits:
src/sr/timeout.rs#L184
warning: the borrowed expression implements the required traits
--> src/sr/timeout.rs:184:15
|
184 | .join(&user.user.uid.as_raw().to_string())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `user.user.uid.as_raw().to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/sr/timeout.rs#L181
warning: the borrowed expression implements the required traits
--> src/sr/timeout.rs:181:44
|
181 | let path = Path::new(TS_LOCATION).join(&user.user.uid.as_raw().to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `user.user.uid.as_raw().to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/sr/timeout.rs#L164
warning: the borrowed expression implements the required traits
--> src/sr/timeout.rs:164:44
|
164 | let path = Path::new(TS_LOCATION).join(&user.user.uid.as_raw().to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `user.user.uid.as_raw().to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
name `PPID` contains a capitalized acronym:
src/sr/timeout.rs#L40
warning: name `PPID` contains a capitalized acronym
--> src/sr/timeout.rs:40:5
|
40 | 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#L39
warning: name `TTY` contains a capitalized acronym
--> src/sr/timeout.rs:39:5
|
39 | 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
= note: `#[warn(clippy::upper_case_acronyms)]` on by default
|
method `leak` is never used:
src/sr/pam/securemem.rs#L29
warning: method `leak` is never used
--> src/sr/pam/securemem.rs:29:12
|
26 | impl PamBuffer {
| -------------- method in this implementation
...
29 | pub fn leak(self) -> NonNull<u8> {
| ^^^^
|
function `errno_location` is never used:
src/sr/pam/cutils.rs#L27
warning: function `errno_location` is never used
--> src/sr/pam/cutils.rs:27:8
|
27 | fn errno_location() -> *mut libc::c_int;
| ^^^^^^^^^^^^^^
|
function `safe_isatty` is never used:
src/sr/pam/cutils.rs#L72
warning: function `safe_isatty` is never used
--> src/sr/pam/cutils.rs:72:8
|
72 | pub fn safe_isatty(fildes: libc::c_int) -> bool {
| ^^^^^^^^^^^
|
function `os_string_from_ptr` is never used:
src/sr/pam/cutils.rs#L60
warning: function `os_string_from_ptr` is never used
--> src/sr/pam/cutils.rs:60:15
|
60 | pub unsafe fn os_string_from_ptr(ptr: *const libc::c_char) -> OsString {
| ^^^^^^^^^^^^^^^^^^
|
function `string_from_ptr` is never used:
src/sr/pam/cutils.rs#L46
warning: function `string_from_ptr` is never used
--> src/sr/pam/cutils.rs:46:15
|
46 | pub unsafe fn string_from_ptr(ptr: *const libc::c_char) -> String {
| ^^^^^^^^^^^^^^^
|
function `sysconf` is never used:
src/sr/pam/cutils.rs#L34
warning: function `sysconf` is never used
--> src/sr/pam/cutils.rs:34:8
|
34 | pub fn sysconf(name: libc::c_int) -> Option<libc::c_long> {
| ^^^^^^^
|
function `set_errno` is never used:
src/sr/pam/cutils.rs#L30
warning: function `set_errno` is never used
--> src/sr/pam/cutils.rs:30:8
|
30 | pub fn set_errno(no: libc::c_int) {
| ^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
unexpected `cfg` condition name: `tarpaulin_include`:
src/chsr/main.rs#L19
warning: unexpected `cfg` condition name: `tarpaulin_include`
--> src/chsr/main.rs:19:11
|
19 | #[cfg(not(tarpaulin_include))]
| ^^^^^^^^^^^^^^^^^
|
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
= help: consider using a Cargo feature instead
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(tarpaulin_include)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
|
unexpected `cfg` condition name: `tarpaulin_include`:
src/sr/main.rs#L188
warning: unexpected `cfg` condition name: `tarpaulin_include`
--> src/sr/main.rs:188:11
|
188 | #[cfg(not(tarpaulin_include))]
| ^^^^^^^^^^^^^^^^^
|
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
= help: consider using a Cargo feature instead
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(tarpaulin_include)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
|
passing a unit value to a function:
rar-common/src/util.rs#L79
warning: passing a unit value to a function
--> rar-common/src/util.rs:79:5
|
79 | / Ok(match effective {
80 | | false => {
81 | | read_effective(false).and(dac_override_effective(false))?;
82 | | }
... |
85 | | }
86 | | })
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
= note: `#[warn(clippy::unit_arg)]` on by default
help: move the expression in front of the call and replace it with the unit literal `()`
|
79 ~ match effective {
80 + false => {
81 + read_effective(false).and(dac_override_effective(false))?;
82 + }
83 + true => {
84 + read_effective(true).or(dac_override_effective(true))?;
85 + }
86 + };
87 + Ok(())
|
|
field assignment outside of initializer for an instance created with Default::default():
rar-common/src/database/structs.rs#L409
warning: field assignment outside of initializer for an instance created with Default::default()
--> rar-common/src/database/structs.rs:409:9
|
409 | ret.name = name;
| ^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `database::structs::STask { name: name, _role: Some(role), ..Default::default() }` and removing relevant reassignments
--> rar-common/src/database/structs.rs:408:9
|
408 | 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():
rar-common/src/database/structs.rs#L392
warning: field assignment outside of initializer for an instance created with Default::default()
--> rar-common/src/database/structs.rs:392:9
|
392 | ret.name = name;
| ^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `database::structs::SRole { name: name, _config: Some(config), ..Default::default() }` and removing relevant reassignments
--> rar-common/src/database/structs.rs:391:9
|
391 | 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():
rar-common/src/database/structs.rs#L327
warning: field assignment outside of initializer for an instance created with Default::default()
--> rar-common/src/database/structs.rs:327:9
|
327 | c.add = capset;
| ^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `database::structs::SCapabilities { add: capset, ..Default::default() }` and removing relevant reassignments
--> rar-common/src/database/structs.rs:326:9
|
326 | let mut c = SCapabilities::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
enum `SGroups` has a public `len` method, but no `is_empty` method:
rar-common/src/database/structs.rs#L84
warning: enum `SGroups` has a public `len` method, but no `is_empty` method
--> rar-common/src/database/structs.rs:84:5
|
84 | pub fn len(&self) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
= note: `#[warn(clippy::len_without_is_empty)]` on by default
|
very complex type used. Consider factoring parts into `type` definitions:
rar-common/src/database/options.rs#L864
warning: very complex type used. Consider factoring parts into `type` definitions
--> rar-common/src/database/options.rs:864:10
|
864 | ) -> (
| __________^
865 | | EnvBehavior,
866 | | HashMap<String, String>,
867 | | LinkedHashSet<EnvKey>,
868 | | LinkedHashSet<EnvKey>,
869 | | LinkedHashSet<EnvKey>,
870 | | ) {
| |_____^
|
= 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:
rar-common/src/database/options.rs#L730
warning: very complex type used. Consider factoring parts into `type` definitions
--> rar-common/src/database/options.rs:730:10
|
730 | ) -> (
| __________^
731 | | PathBehavior,
732 | | Rc<RefCell<LinkedHashSet<String>>>,
733 | | Rc<RefCell<LinkedHashSet<String>>>,
734 | | ) {
| |_____^
|
= 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:
rar-common/src/database/options.rs#L675
warning: very complex type used. Consider factoring parts into `type` definitions
--> rar-common/src/database/options.rs:675:10
|
675 | ) -> (
| __________^
676 | | PathBehavior,
677 | | Rc<RefCell<LinkedHashSet<String>>>,
678 | | Rc<RefCell<LinkedHashSet<String>>>,
679 | | ) {
| |_____^
|
= 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():
rar-common/src/database/options.rs#L587
warning: field assignment outside of initializer for an instance created with Default::default()
--> rar-common/src/database/options.rs:587:9
|
587 | opt.level = Level::Global;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `database::options::Opt { level: Level::Global, root: Some(SPrivileged::User), bounding: Some(SBounding::Strict), ..Default::default() }` and removing relevant reassignments
--> rar-common/src/database/options.rs:586:9
|
586 | 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:
rar-common/src/database/options.rs#L479
warning: stripping a prefix manually
--> rar-common/src/database/options.rs:479:9
|
479 | &tzval[1..]
| ^^^^^^^^^^^
|
note: the prefix was tested here
--> rar-common/src/database/options.rs:478:17
|
478 | 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
|
478 ~ let tzval = if let Some(<stripped>) = tzval.strip_prefix(':') {
479 ~ <stripped>
|
|
field assignment outside of initializer for an instance created with Default::default():
rar-common/src/database/options.rs#L436
warning: field assignment outside of initializer for an instance created with Default::default()
--> rar-common/src/database/options.rs:436:9
|
436 | res.default_behavior = behavior;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `database::options::SEnvOptions { default_behavior: behavior, ..Default::default() }` and removing relevant reassignments
--> rar-common/src/database/options.rs:435:9
|
435 | 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():
rar-common/src/database/options.rs#L415
warning: field assignment outside of initializer for an instance created with Default::default()
--> rar-common/src/database/options.rs:415:9
|
415 | res.default_behavior = behavior;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `database::options::SPathOptions { default_behavior: behavior, ..Default::default() }` and removing relevant reassignments
--> rar-common/src/database/options.rs:414:9
|
414 | 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():
rar-common/src/database/options.rs#L278
warning: field assignment outside of initializer for an instance created with Default::default()
--> rar-common/src/database/options.rs:278:9
|
278 | timeout.type_field = Some(TimestampType::PPID);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `database::options::STimeout { type_field: Some(TimestampType::PPID), duration: Some(Duration::minutes(5)), ..Default::default() }` and removing relevant reassignments
--> rar-common/src/database/options.rs:277:9
|
277 | 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():
rar-common/src/database/options.rs#L226
warning: field assignment outside of initializer for an instance created with Default::default()
--> rar-common/src/database/options.rs:226:9
|
226 | opt.level = level;
| ^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `database::options::Opt { level: level, ..Default::default() }` and removing relevant reassignments
--> rar-common/src/database/options.rs:225:9
|
225 | let mut opt = Self::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
= note: `#[warn(clippy::field_reassign_with_default)]` on by default
|
direct implementation of `ToString`:
rar-common/src/database/options.rs#L132
warning: direct implementation of `ToString`
--> rar-common/src/database/options.rs:132:1
|
132 | / impl ToString for EnvKey {
133 | | fn to_string(&self) -> String {
134 | | self.value.clone()
135 | | }
136 | | }
| |_^
|
= help: prefer implementing `Display` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
= note: `#[warn(clippy::to_string_trait_impl)]` on by default
|
very complex type used. Consider factoring parts into `type` definitions:
rar-common/src/database/migration.rs#L12
warning: very complex type used. Consider factoring parts into `type` definitions
--> rar-common/src/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:
rar-common/src/database/migration.rs#L11
warning: very complex type used. Consider factoring parts into `type` definitions
--> rar-common/src/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
|
unneeded `return` statement:
rar-common/src/database/finder.rs#L363
warning: unneeded `return` statement
--> rar-common/src/database/finder.rs:363:9
|
363 | return Ok(CmdMin::Match);
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
363 - return Ok(CmdMin::Match);
363 + Ok(CmdMin::Match)
|
|
unneeded `return` statement:
rar-common/src/database/finder.rs#L359
warning: unneeded `return` statement
--> rar-common/src/database/finder.rs:359:9
|
359 | / return evaluate_regex_cmd(role_args, commandline).inspect_err(|e| {
360 | | debug!("No match for args {:?}", input_args);
361 | | });
| |__________^
|
= 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`
|
359 ~ evaluate_regex_cmd(role_args, commandline).inspect_err(|e| {
360 + debug!("No match for args {:?}", input_args);
361 ~ })
|
|
you should consider adding a `Default` implementation for `PluginManager`:
rar-common/src/api.rs#L97
warning: you should consider adding a `Default` implementation for `PluginManager`
--> rar-common/src/api.rs:97:5
|
97 | / pub fn new() -> Self {
98 | | PluginManager {
99 | | #[cfg(feature = "finder")]
100 | | role_matcher_plugins: Vec::new(),
... |
113 | | }
114 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
|
96 + impl Default for PluginManager {
97 + fn default() -> Self {
98 + Self::new()
99 + }
100 + }
|
|
methods `get_opt` and `get_lowest_level` are never used:
rar-common/src/database/options.rs#L614
warning: methods `get_opt` and `get_lowest_level` are never used
--> rar-common/src/database/options.rs:614:8
|
540 | impl OptStack {
| ------------- methods in this implementation
...
614 | fn get_opt(&self, level: Level) -> Option<Rc<RefCell<Opt>>> {
| ^^^^^^^
...
1094 | fn get_lowest_level(&self) -> Level {
| ^^^^^^^^^^^^^^^^
|
associated function `new` is never used:
rar-common/src/database/options.rs#L413
warning: associated function `new` is never used
--> rar-common/src/database/options.rs:413:8
|
412 | impl SPathOptions {
| ----------------- associated function in this implementation
413 | fn new(behavior: PathBehavior) -> Self {
| ^^^
|
= note: `#[warn(dead_code)]` on by default
|
unused variable: `e`:
rar-common/src/database/finder.rs#L359
warning: unused variable: `e`
--> rar-common/src/database/finder.rs:359:72
|
359 | return evaluate_regex_cmd(role_args, commandline).inspect_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:
rar-common/src/version.rs#L4
warning: constants have by default a `'static` lifetime
--> rar-common/src/version.rs:4:29
|
4 | pub const PACKAGE_VERSION: &'static str = "3.0.0-alpha.5";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
= note: `#[warn(clippy::redundant_static_lifetimes)]` on by default
|
this seems like a manual implementation of the non-exhaustive pattern:
rar-common/src/database/structs.rs#L30
warning: this seems like a manual implementation of the non-exhaustive pattern
--> rar-common/src/database/structs.rs:30:1
|
30 | pub struct SConfig {
| ^-----------------
| |
| _help: add the attribute: `#[non_exhaustive] pub struct SConfig`
| |
31 | | #[serde(skip_serializing_if = "Option::is_none")]
32 | | pub options: OptWrapper,
33 | | #[serde(default, skip_serializing_if = "Vec::is_empty")]
... |
39 | | pub _extra_fields: Map<String, Value>,
40 | | }
| |_^
|
help: remove this field
--> rar-common/src/database/structs.rs:36:5
|
36 | 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
|
unexpected `cfg` condition name: `tarpaulin_include`:
rar-common/src/database/options.rs#L971
warning: unexpected `cfg` condition name: `tarpaulin_include`
--> rar-common/src/database/options.rs:971:15
|
971 | #[cfg(not(tarpaulin_include))]
| ^^^^^^^^^^^^^^^^^
|
= help: consider using a Cargo feature instead
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(tarpaulin_include)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
unexpected `cfg` condition name: `tarpaulin_include`:
rar-common/src/database/options.rs#L727
warning: unexpected `cfg` condition name: `tarpaulin_include`
--> rar-common/src/database/options.rs:727:15
|
727 | #[cfg(not(tarpaulin_include))]
| ^^^^^^^^^^^^^^^^^
|
= help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
= help: consider using a Cargo feature instead
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(tarpaulin_include)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
|
function `write_doc` is never used:
build.rs#L58
warning: function `write_doc` is never used
--> build.rs:58:4
|
58 | fn write_doc(f: &mut File) -> Result<(), Box<dyn Error>> {
| ^^^^^^^^^
|
function `set_pkgbuild_version` is never used:
build.rs#L42
warning: function `set_pkgbuild_version` is never used
--> build.rs:42:4
|
42 | fn set_pkgbuild_version(package_version: &str, file: &str) -> Result<(), Box<dyn Error>> {
| ^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
rust-coverage
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
rust-coverage
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v2, codecov/codecov-action@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|