Bump deps, update readme, release #133
Annotations
44 warnings
Audit
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/audit-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
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/
|
using `clone` on type `FormatConfig` which implements the `Copy` trait:
src/bin/genemichaels.rs#L350
warning: using `clone` on type `FormatConfig` which implements the `Copy` trait
--> src/bin/genemichaels.rs:350:22
|
350 | 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#L333
warning: unneeded `return` statement
--> src/bin/genemichaels.rs:333:9
|
333 | / return FormatPool {
334 | | log: log.clone(),
335 | | config: config,
336 | | pool: {
... |
343 | | errors: Arc::new(Mutex::new(vec![])),
344 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
333 ~ FormatPool {
334 + log: log.clone(),
335 + config: config,
336 + pool: {
337 + let mut p = threadpool::Builder::new();
338 + if let Some(t) = thread_count {
339 + p = p.num_threads(t);
340 + }
341 + p.build()
342 + },
343 + errors: Arc::new(Mutex::new(vec![])),
344 ~ }
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/bin/genemichaels.rs#L190
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/bin/genemichaels.rs:190:38
|
190 | 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
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/bin/genemichaels.rs#L175
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/bin/genemichaels.rs:175:38
|
175 | 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#L105
warning: unneeded `return` statement
--> src/bin/genemichaels.rs:105:21
|
105 | return true;
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
105 - return true;
105 + true
|
|
question mark operator is useless here:
src/bin/genemichaels.rs#L96
warning: question mark operator is useless here
--> src/bin/genemichaels.rs:96:12
|
96 | return Ok(
| ____________^
97 | | serde_json::from_str(
98 | | &String::from_utf8(read(path).stack_context(log, "Failed to read config file")?)
99 | | .stack_context(log, "Failed to decode file as utf8")?
... |
109 | | ).stack_context(log, "Failed to parse file as json")?,
110 | | );
| |_____^
|
= 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()`
|
96 ~ return serde_json::from_str(
97 + &String::from_utf8(read(path).stack_context(log, "Failed to read config file")?)
98 + .stack_context(log, "Failed to decode file as utf8")?
99 + .lines()
100 + .filter(|l| {
101 + if l.trim_start().starts_with("//") {
102 + return false;
103 + }
104 + return true;
105 + })
106 + .collect::<Vec<&str>>()
107 + .join("\n"),
108 ~ ).stack_context(log, "Failed to parse file as json");
|
|
this `let...else` may be rewritten with the `?` operator:
src/bin/genemichaels.rs#L83
warning: this `let...else` may be rewritten with the `?` operator
--> src/bin/genemichaels.rs:83:9
|
83 | / let Some(p) = p else {
84 | | return None;
85 | | };
| |__________^ help: replace it with: `let p = p?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
= note: `#[warn(clippy::question_mark)]` on by default
|
unneeded `return` statement:
src/bin/genemichaels.rs#L90
warning: unneeded `return` statement
--> src/bin/genemichaels.rs:90:9
|
90 | return Some(p);
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
90 - return Some(p);
90 + Some(p)
|
|
unneeded `return` statement:
src/bin/genemichaels.rs#L96
warning: unneeded `return` statement
--> src/bin/genemichaels.rs:96:5
|
96 | / return Ok(
97 | | serde_json::from_str(
98 | | &String::from_utf8(read(path).stack_context(log, "Failed to read config file")?)
99 | | .stack_context(log, "Failed to decode file as utf8")?
... |
109 | | ).stack_context(log, "Failed to parse file as json")?,
110 | | );
| |_____^
|
= 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`
|
96 ~ Ok(
97 + serde_json::from_str(
98 + &String::from_utf8(read(path).stack_context(log, "Failed to read config file")?)
99 + .stack_context(log, "Failed to decode file as utf8")?
100 + .lines()
101 + .filter(|l| {
102 + if l.trim_start().starts_with("//") {
103 + return false;
104 + }
105 + return true;
106 + })
107 + .collect::<Vec<&str>>()
108 + .join("\n"),
109 + ).stack_context(log, "Failed to parse file as json")?,
110 ~ )
|
|
redundant field names in struct initialization:
src/bin/genemichaels.rs#L335
warning: redundant field names in struct initialization
--> src/bin/genemichaels.rs:335:13
|
335 | 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
|
accessing first element with `new_segs.get(0)`:
src/lib.rs#L202
warning: accessing first element with `new_segs.get(0)`
--> src/lib.rs:202:21
|
202 | let seg_i = new_segs.get(0).unwrap();
| ^^^^^^^^^^^^^^^ help: try: `new_segs.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
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`
|
566 ~ Some(Whitespace {
567 + loc: w.loc,
568 + mode: WhitespaceMode::Comment(c),
569 ~ })
|
|
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`
|
560 ~ Some(Whitespace {
561 + loc: w.loc,
562 + mode: WhitespaceMode::BlankLines(use_lines),
563 ~ })
|
|
accessing first element with `children.get(0)`:
src/sg_expr.rs#L165
warning: accessing first element with `children.get(0)`
--> src/sg_expr.rs:165:48
|
165 | sg.child(build_child(out, base_indent, children.get(0).unwrap()));
| ^^^^^^^^^^^^^^^ help: try: `children.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/whitespace.rs#L981
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/whitespace.rs:981:29
|
981 | 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
|
in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`:
src/whitespace.rs#L967
warning: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
--> src/whitespace.rs:967:15
|
967 | match es!({
| _______________^
968 | | let mut out = String::new();
969 | | let mut state = State {
970 | | line_buffer: String::new(),
... |
991 | | Ok(out)
992 | | }) {
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_conditions
= note: `#[warn(clippy::blocks_in_conditions)]` on by default
|
accessing first element with `x.children.get(0)`:
src/whitespace.rs#L910
warning: accessing first element with `x.children.get(0)`
--> src/whitespace.rs:910:17
|
910 | x.children.get(0)
| ^^^^^^^^^^^^^^^^^ help: try: `x.children.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
accessing first element with `x.children.get(0)`:
src/whitespace.rs#L853
warning: accessing first element with `x.children.get(0)`
--> src/whitespace.rs:853:17
|
853 | x.children.get(0)
| ^^^^^^^^^^^^^^^^^ help: try: `x.children.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
= note: `#[warn(clippy::get_first)]` on by default
|
this expression borrows a value the compiler would automatically borrow:
src/whitespace.rs#L627
warning: this expression borrows a value the compiler would automatically borrow
--> src/whitespace.rs:627:70
|
627 | 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#L612
warning: this expression borrows a value the compiler would automatically borrow
--> src/whitespace.rs:612:17
|
612 | (&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#L565
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/whitespace.rs:565:40
|
565 | 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#L550
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/whitespace.rs:550:50
|
550 | 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#L549
warning: unneeded `return` statement
--> src/whitespace.rs:549:13
|
549 | / return FoundWritableLen {
550 | | writable: if width + unicode_len(&text) > max_len {
551 | | writable
552 | | } else {
... |
556 | | next_break: None,
557 | | };
| |_____________^
|
= 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`
|
549 ~ FoundWritableLen {
550 + writable: if width + unicode_len(&text) > max_len {
551 + writable
552 + } else {
553 + text.len()
554 + },
555 + previous_break: previous_break,
556 + next_break: None,
557 ~ }
|
|
calling `push_str()` using a single-character string literal:
src/whitespace.rs#L259
warning: calling `push_str()` using a single-character string literal
--> src/whitespace.rs:259:25
|
259 | 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
|
use of `or_insert` to construct default value:
src/whitespace.rs#L240
warning: use of `or_insert` to construct default value
--> src/whitespace.rs:240:79
|
240 | let whitespaces = self.whitespaces.entry(HashLineColumn(end)).or_insert(vec![]);
| ^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
= note: `#[warn(clippy::unwrap_or_default)]` on by default
|
useless conversion to the same type: `&str`:
src/whitespace.rs#L183
warning: useless conversion to the same type: `&str`
--> src/whitespace.rs:183:65
|
183 | ... 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#L845
warning: redundant field names in struct initialization
--> src/lib.rs:845:9
|
845 | 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#L843
warning: redundant field names in struct initialization
--> src/lib.rs:843:9
|
843 | 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#L555
warning: redundant field names in struct initialization
--> src/whitespace.rs:555:17
|
555 | 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#L543
warning: redundant field names in struct initialization
--> src/whitespace.rs:543:25
|
543 | 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#L542
warning: redundant field names in struct initialization
--> src/whitespace.rs:542:25
|
542 | 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#L541
warning: redundant field names in struct initialization
--> src/whitespace.rs:541:25
|
541 | 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#L465
warning: redundant field names in struct initialization
--> src/whitespace.rs:465:13
|
465 | 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
|
redundant field names in struct initialization:
src/whitespace.rs#L312
warning: redundant field names in struct initialization
--> src/whitespace.rs:312:9
|
312 | line_lookup: line_lookup,
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `line_lookup`
|
= 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#L311
warning: redundant field names in struct initialization
--> src/whitespace.rs:311:9
|
311 | keep_max_blank_lines: keep_max_blank_lines,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `keep_max_blank_lines`
|
= 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#L310
warning: redundant field names in struct initialization
--> src/whitespace.rs:310:9
|
310 | source: source,
| ^^^^^^^^^^^^^^ help: replace it with: `source`
|
= 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
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
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/
|
Test
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/.
|