Relax deps, upgrade deps, bump #127
Annotations
1 error and 36 warnings
Audit
Critical vulnerabilities were found, marking check as failed
|
unneeded `return` statement:
src/bin/genemichaels.rs#L356
warning: unneeded `return` statement
--> src/bin/genemichaels.rs:356:17
|
356 | return Ok(());
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= help: remove `return`
|
using `clone` on type `FormatConfig` which implements the `Copy` trait:
src/bin/genemichaels.rs#L342
warning: using `clone` on type `FormatConfig` which implements the `Copy` trait
--> src/bin/genemichaels.rs:342:22
|
342 | let config = self.config.clone();
| ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.config`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
|
unneeded `return` statement:
src/bin/genemichaels.rs#L325
warning: unneeded `return` statement
--> src/bin/genemichaels.rs:325:9
|
325 | / return FormatPool {
326 | | log: log.clone(),
327 | | config: config,
328 | | pool: {
... |
335 | | errors: Arc::new(Mutex::new(vec![])),
336 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= help: remove `return`
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/bin/genemichaels.rs#L181
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/bin/genemichaels.rs:181:38
|
181 | let config = load_config(&log, &[args.config, Some(PathBuf::from(CONFIG_JSON))])?;
| ^^^^ help: change this to: `log`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
unneeded `return` statement:
src/bin/genemichaels.rs#L177
warning: unneeded `return` statement
--> src/bin/genemichaels.rs:177:21
|
177 | return Ok(());
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= help: remove `return`
|
unneeded `return` statement:
src/bin/genemichaels.rs#L173
warning: unneeded `return` statement
--> src/bin/genemichaels.rs:173:21
|
173 | return Ok(());
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= help: remove `return`
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/bin/genemichaels.rs#L166
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/bin/genemichaels.rs:166:38
|
166 | let config = load_config(&log, &[args.config, Some(PathBuf::from(CONFIG_JSON))])?;
| ^^^^ help: change this to: `log`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
unneeded `return` statement:
src/bin/genemichaels.rs#L302
warning: unneeded `return` statement
--> src/bin/genemichaels.rs:302:9
|
302 | return Ok(());
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= help: remove `return`
|
unneeded `return` statement:
src/bin/genemichaels.rs#L102
warning: unneeded `return` statement
--> src/bin/genemichaels.rs:102:21
|
102 | return true;
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= help: remove `return`
|
question mark operator is useless here:
src/bin/genemichaels.rs#L93
warning: question mark operator is useless here
--> src/bin/genemichaels.rs:93:12
|
93 | return Ok(
| ____________^
94 | | serde_json::from_str(
95 | | &String::from_utf8(read(path).log_context(log, "Failed to read config file")?)
96 | | .log_context(log, "Failed to decode file as utf8")?
... |
106 | | ).log_context(log, "Failed to parse file as json")?,
107 | | );
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
help: try removing question mark and `Ok()`
|
93 ~ return serde_json::from_str(
94 + &String::from_utf8(read(path).log_context(log, "Failed to read config file")?)
95 + .log_context(log, "Failed to decode file as utf8")?
96 + .lines()
97 + .filter(|l| {
98 + if l.trim_start().starts_with("//") {
99 + return false;
100 + }
101 + return true;
102 + })
103 + .collect::<Vec<&str>>()
104 + .join("\n"),
105 ~ ).log_context(log, "Failed to parse file as json");
|
|
unneeded `return` statement:
src/bin/genemichaels.rs#L87
warning: unneeded `return` statement
--> src/bin/genemichaels.rs:87:9
|
87 | return Some(p);
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= help: remove `return`
|
unneeded `return` statement:
src/bin/genemichaels.rs#L93
warning: unneeded `return` statement
--> src/bin/genemichaels.rs:93:5
|
93 | / return Ok(
94 | | serde_json::from_str(
95 | | &String::from_utf8(read(path).log_context(log, "Failed to read config file")?)
96 | | .log_context(log, "Failed to decode file as utf8")?
... |
106 | | ).log_context(log, "Failed to parse file as json")?,
107 | | );
| |_____^
|
= 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`
|
redundant field names in struct initialization:
src/bin/genemichaels.rs#L327
warning: redundant field names in struct initialization
--> src/bin/genemichaels.rs:327:13
|
327 | config: config,
| ^^^^^^^^^^^^^^ help: replace it with: `config`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `#[warn(clippy::redundant_field_names)]` on by default
|
using `clone` on type `FormatConfig` which implements the `Copy` trait:
src/lib.rs#L544
warning: using `clone` on type `FormatConfig` which implements the `Copy` trait
--> src/lib.rs:544:17
|
544 | config: config.clone(),
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*config`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
|
this loop could be written as a `while let` loop:
src/sg_pat.rs#L78
warning: this loop could be written as a `while let` loop
--> src/sg_pat.rs:78:29
|
78 | / ... loop {
79 | | ... let t = match at.1.as_ref() {
80 | | ... Pat::Tuple(t) => t,
81 | | ... _ => break,
... |
124 | | ... return sg0.build(out);
125 | | ... };
| |_______________________^ help: try: `while let Pat::Tuple(t) = at.1.as_ref() { .. }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop
= note: `#[warn(clippy::while_let_loop)]` on by default
|
unneeded `return` statement:
src/sg_general.rs#L566
warning: unneeded `return` statement
--> src/sg_general.rs:566:17
|
566 | / return Some(Whitespace {
567 | | loc: w.loc,
568 | | mode: WhitespaceMode::Comment(c),
569 | | });
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= help: remove `return`
|
unneeded `return` statement:
src/sg_general.rs#L560
warning: unneeded `return` statement
--> src/sg_general.rs:560:17
|
560 | / return Some(Whitespace {
561 | | loc: w.loc,
562 | | mode: WhitespaceMode::BlankLines(use_lines),
563 | | });
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= help: remove `return`
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/whitespace.rs#L974
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/whitespace.rs:974:29
|
974 | unicode_len(&prefix),
| ^^^^^^^ help: change this to: `prefix`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression borrows a value the compiler would automatically borrow:
src/whitespace.rs#L620
warning: this expression borrows a value the compiler would automatically borrow
--> src/whitespace.rs:620:70
|
620 | write_forward_breaks(state, &mut s, out, max_len, false, (&text[b..]).to_string(), b, breaks);
| ^^^^^^^^^^^^ help: change this to: `text[b..]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression borrows a value the compiler would automatically borrow:
src/whitespace.rs#L605
warning: this expression borrows a value the compiler would automatically borrow
--> src/whitespace.rs:605:17
|
605 | (&text[found.writable..]).to_string(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `text[found.writable..]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/whitespace.rs#L558
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/whitespace.rs:558:40
|
558 | state.line_buffer.push_str(&text);
| ^^^^^ help: change this to: `text`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/whitespace.rs#L543
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/whitespace.rs:543:50
|
543 | writable: if width + unicode_len(&text) > max_len {
| ^^^^^ help: change this to: `text`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
unneeded `return` statement:
src/whitespace.rs#L542
warning: unneeded `return` statement
--> src/whitespace.rs:542:13
|
542 | / return FoundWritableLen {
543 | | writable: if width + unicode_len(&text) > max_len {
544 | | writable
545 | | } else {
... |
549 | | next_break: None,
550 | | };
| |_____________^
|
= 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`
|
calling `push_str()` using a single-character string literal:
src/whitespace.rs#L253
warning: calling `push_str()` using a single-character string literal
--> src/whitespace.rs:253:25
|
253 | previous_comment.lines.push_str("\n");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `previous_comment.lines.push('\n')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
= note: `#[warn(clippy::single_char_add_str)]` on by default
|
useless conversion to the same type: `&str`:
src/whitespace.rs#L177
warning: useless conversion to the same type: `&str`
--> src/whitespace.rs:177:65
|
177 | ... buffer.add(CommentMode::Normal, "".into());
| ^^^^^^^^^ help: consider removing `.into()`: `""`
|
= 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
|
redundant field names in struct initialization:
src/lib.rs#L846
warning: redundant field names in struct initialization
--> src/lib.rs:846:9
|
846 | warnings: warnings,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `warnings`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/lib.rs#L844
warning: redundant field names in struct initialization
--> src/lib.rs:844:9
|
844 | rendered: rendered,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `rendered`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/whitespace.rs#L548
warning: redundant field names in struct initialization
--> src/whitespace.rs:548:17
|
548 | previous_break: previous_break,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `previous_break`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/whitespace.rs#L536
warning: redundant field names in struct initialization
--> src/whitespace.rs:536:25
|
536 | next_break: next_break,
| ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `next_break`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/whitespace.rs#L535
warning: redundant field names in struct initialization
--> src/whitespace.rs:535:25
|
535 | previous_break: previous_break,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `previous_break`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/whitespace.rs#L534
warning: redundant field names in struct initialization
--> src/whitespace.rs:534:25
|
534 | writable: writable,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `writable`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/whitespace.rs#L458
warning: redundant field names in struct initialization
--> src/whitespace.rs:458:13
|
458 | base_prefix_len: base_prefix_len,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `base_prefix_len`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `#[warn(clippy::redundant_field_names)]` on by default
|
lint `clippy::derive_hash_xor_eq` has been renamed to `clippy::derived_hash_with_manual_eq`:
src/lib.rs#L5
warning: lint `clippy::derive_hash_xor_eq` has been renamed to `clippy::derived_hash_with_manual_eq`
--> src/lib.rs:5:5
|
5 | clippy::derive_hash_xor_eq,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::derived_hash_with_manual_eq`
|
= note: `#[warn(renamed_and_removed_lints)]` on by default
|
Clippy
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Audit
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/audit-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Audit
1 vulnerabilities found!
|