fixes #170 #284
clippy
9 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 9 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.73.0 (cc66ad468 2023-10-03)
- cargo 1.73.0 (9c4383fb5 2023-08-26)
- clippy 0.1.73 (cc66ad4 2023-10-03)
Annotations
Check warning on line 166 in src/serde.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> src/serde.rs:166:31
|
166 | if valid_variants == 0 && e.variants().len() != 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!e.variants().is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
Check warning on line 633 in src/lang/ts/mod.rs
github-actions / clippy
called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent
warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent
--> src/lang/ts/mod.rs:633:31
|
633 | if let Some(first_char) = ident.chars().nth(0) {
| ^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `ident.chars().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)]` implied by `#[warn(clippy::all)]`
Check warning on line 429 in src/lang/ts/mod.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> src/lang/ts/mod.rs:429:24
|
429 | if obj.fields.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `obj.fields.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` implied by `#[warn(clippy::all)]`
Check warning on line 223 in src/lang/ts/mod.rs
github-actions / clippy
single-character string constant used as pattern
warning: single-character string constant used as pattern
--> src/lang/ts/mod.rs:223:74
|
223 | || (dt.contains(' ') && (dt.contains("&") || dt.contains("|")))
| ^^^ help: try using a `char` instead: `'|'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
Check warning on line 223 in src/lang/ts/mod.rs
github-actions / clippy
single-character string constant used as pattern
warning: single-character string constant used as pattern
--> src/lang/ts/mod.rs:223:54
|
223 | || (dt.contains(' ') && (dt.contains("&") || dt.contains("|")))
| ^^^ help: try using a `char` instead: `'&'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
= note: `#[warn(clippy::single_char_pattern)]` implied by `#[warn(clippy::all)]`
Check warning on line 107 in src/lang/ts/mod.rs
github-actions / clippy
using a reference to `Cow` is not recommended
warning: using a reference to `Cow` is not recommended
--> src/lang/ts/mod.rs:107:11
|
107 | docs: &Cow<'static, str>,
| ^^^^^^^^^^^^^^^^^^ help: change this to: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` implied by `#[warn(clippy::all)]`
Check warning on line 72 in src/lang/ts/js_doc.rs
github-actions / clippy
calling `push_str()` using a single-character string literal
warning: calling `push_str()` using a single-character string literal
--> src/lang/ts/js_doc.rs:72:9
|
72 | self.value.push_str("\n");
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `self.value.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)]` implied by `#[warn(clippy::all)]`
Check warning on line 21 in src/lang/ts/comments.rs
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
--> src/lang/ts/comments.rs:21:33
|
21 | builder.push_deprecated(&deprecated);
| ^^^^^^^^^^^ help: change this to: `deprecated`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
note: the lint level is defined here
--> src/lib.rs:3:9
|
3 | #![warn(clippy::all, clippy::unwrap_used, clippy::panic)] // TODO: missing_docs
| ^^^^^^^^^^^
= note: `#[warn(clippy::needless_borrow)]` implied by `#[warn(clippy::all)]`
Check warning on line 66 in src/lang/ts/reserved_terms.rs
github-actions / clippy
constant `RESERVED_IDENTS` is never used
warning: constant `RESERVED_IDENTS` is never used
--> src/lang/ts/reserved_terms.rs:66:18
|
66 | pub(crate) const RESERVED_IDENTS: &[&str] = &[
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default