Skip to content

chore: Release

chore: Release #168

GitHub Actions / clippy succeeded Nov 19, 2024 in 1s

clippy

63 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 63
Note 0
Help 0

Versions

  • rustc 1.82.0 (f6e511eec 2024-10-15)
  • cargo 1.82.0 (8f40fc59f 2024-08-21)
  • clippy 0.1.82 (f6e511e 2024-10-15)

Annotations

Check warning on line 341 in crates/genemichaels/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `FormatConfig` which implements the `Copy` trait

warning: using `clone` on type `FormatConfig` which implements the `Copy` trait
   --> crates/genemichaels/src/main.rs:341:22
    |
341 |         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

Check warning on line 335 in crates/genemichaels/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> crates/genemichaels/src/main.rs:324:9
    |
324 | /         return FormatPool {
325 | |             log: log.clone(),
326 | |             config: config,
327 | |             pool: {
...   |
334 | |             errors: Arc::new(Mutex::new(vec![])),
335 | |         };
    | |_________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
324 ~         FormatPool {
325 +             log: log.clone(),
326 +             config: config,
327 +             pool: {
328 +                 let mut p = threadpool::Builder::new();
329 +                 if let Some(t) = thread_count {
330 +                     p = p.num_threads(t);
331 +                 }
332 +                 p.build()
333 +             },
334 +             errors: Arc::new(Mutex::new(vec![])),
335 ~         }
    |

Check warning on line 181 in crates/genemichaels/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> crates/genemichaels/src/main.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

Check warning on line 166 in crates/genemichaels/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> crates/genemichaels/src/main.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

Check warning on line 102 in crates/genemichaels/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> crates/genemichaels/src/main.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`
    |
102 -                     return true;
102 +                     true
    |

Check warning on line 107 in crates/genemichaels/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

question mark operator is useless here

warning: question mark operator is useless here
   --> crates/genemichaels/src/main.rs:93:12
    |
93  |       return Ok(
    |  ____________^
94  | |         serde_json::from_str(
95  | |             &String::from_utf8(read(path).stack_context(log, "Failed to read config file")?)
96  | |                 .stack_context(log, "Failed to decode file as utf8")?
...   |
106 | |         ).stack_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).stack_context(log, "Failed to read config file")?)
95  +                 .stack_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 ~         ).stack_context(log, "Failed to parse file as json");
    |

Check warning on line 87 in crates/genemichaels/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
  --> crates/genemichaels/src/main.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`
   |
87 -         return Some(p);
87 +         Some(p)
   |

Check warning on line 107 in crates/genemichaels/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> crates/genemichaels/src/main.rs:93:5
    |
93  | /     return Ok(
94  | |         serde_json::from_str(
95  | |             &String::from_utf8(read(path).stack_context(log, "Failed to read config file")?)
96  | |                 .stack_context(log, "Failed to decode file as utf8")?
...   |
106 | |         ).stack_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`
    |
93  ~     Ok(
94  +         serde_json::from_str(
95  +             &String::from_utf8(read(path).stack_context(log, "Failed to read config file")?)
96  +                 .stack_context(log, "Failed to decode file as utf8")?
97  +                 .lines()
98  +                 .filter(|l| {
99  +                     if l.trim_start().starts_with("//") {
100 +                         return false;
101 +                     }
102 +                     return true;
103 +                 })
104 +                 .collect::<Vec<&str>>()
105 +                 .join("\n"),
106 +         ).stack_context(log, "Failed to parse file as json")?,
107 ~     )
    |

Check warning on line 326 in crates/genemichaels/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant field names in struct initialization

warning: redundant field names in struct initialization
   --> crates/genemichaels/src/main.rs:326:13
    |
326 |             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

Check warning on line 526 in crates/genemichaels-lib/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `FormatConfig` which implements the `Copy` trait

warning: using `clone` on type `FormatConfig` which implements the `Copy` trait
   --> crates/genemichaels-lib/src/lib.rs:526:17
    |
526 |         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

Check warning on line 184 in crates/genemichaels-lib/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

accessing first element with `new_segs.get(0)`

warning: accessing first element with `new_segs.get(0)`
   --> crates/genemichaels-lib/src/lib.rs:184:21
    |
184 |         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

Check warning on line 708 in crates/genemichaels-lib/src/sg_type.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> crates/genemichaels-lib/src/sg_type.rs:708:25
    |
708 |                         return build_self(out, base_indent);
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
708 -                         return build_self(out, base_indent);
708 +                         build_self(out, base_indent)
    |

Check warning on line 374 in crates/genemichaels-lib/src/sg_type.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> crates/genemichaels-lib/src/sg_type.rs:374:37
    |
374 |                         sg.seg(out, &c.ident.to_string());
    |                                     ^^^^^^^^^^^^^^^^^^^^ help: change this to: `c.ident.to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 127 in crates/genemichaels-lib/src/sg_type.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> crates/genemichaels-lib/src/sg_type.rs:127:23
    |
127 |         node.seg(out, &seg.value().ident.to_string());
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `seg.value().ident.to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 1174 in crates/genemichaels-lib/src/sg_statement.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
    --> crates/genemichaels-lib/src/sg_statement.rs:1174:29
     |
1174 |                 sg.seg(out, &x.ident.to_string());
     |                             ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 1169 in crates/genemichaels-lib/src/sg_statement.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
    --> crates/genemichaels-lib/src/sg_statement.rs:1169:29
     |
1169 |                 sg.seg(out, &format!("{}::", x.ident));
     |                             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}::", x.ident)`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 1151 in crates/genemichaels-lib/src/sg_statement.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
    --> crates/genemichaels-lib/src/sg_statement.rs:1151:29
     |
1151 |                 sg.seg(out, &format!("{}: ", n));
     |                             ^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}: ", n)`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 1033 in crates/genemichaels-lib/src/sg_statement.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
    --> crates/genemichaels-lib/src/sg_statement.rs:1033:33
     |
1033 |                     sg.seg(out, &x.ident.to_string());
     |                                 ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 871 in crates/genemichaels-lib/src/sg_statement.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> crates/genemichaels-lib/src/sg_statement.rs:871:33
    |
871 |                     sg.seg(out, &x.ident.to_string());
    |                                 ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 853 in crates/genemichaels-lib/src/sg_statement.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> crates/genemichaels-lib/src/sg_statement.rs:853:33
    |
853 |                     sg.seg(out, &x.ident.to_string());
    |                                 ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 821 in crates/genemichaels-lib/src/sg_statement.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> crates/genemichaels-lib/src/sg_statement.rs:821:33
    |
821 |                     sg.seg(out, &x.ident.to_string());
    |                                 ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 806 in crates/genemichaels-lib/src/sg_statement.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> crates/genemichaels-lib/src/sg_statement.rs:806:37
    |
806 |                         sg.seg(out, &format!(" {}", n));
    |                                     ^^^^^^^^^^^^^^^^^^ help: change this to: `format!(" {}", n)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 669 in crates/genemichaels-lib/src/sg_statement.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> crates/genemichaels-lib/src/sg_statement.rs:669:33
    |
669 |                     sg.seg(out, &x.ident.to_string());
    |                                 ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 648 in crates/genemichaels-lib/src/sg_statement.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> crates/genemichaels-lib/src/sg_statement.rs:648:33
    |
648 |                     sg.seg(out, &x.ident.to_string());
    |                                 ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 190 in crates/genemichaels-lib/src/sg_statement.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> crates/genemichaels-lib/src/sg_statement.rs:190:33
    |
190 |                     sg.seg(out, &l.semi_token.to_token_stream());
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `l.semi_token.to_token_stream()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args