Skip to content

Docs in main repo #2

Docs in main repo

Docs in main repo #2

GitHub Actions / clippy succeeded Oct 3, 2024 in 1s

clippy

15 warnings

Details

Results

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

Versions

  • rustc 1.81.0 (eeb90cda1 2024-09-04)
  • cargo 1.81.0 (2dbb1af80 2024-08-20)
  • clippy 0.1.81 (eeb90cda 2024-09-04)

Annotations

Check warning on line 181 in src/check/constrain/generate/definition.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

call to `.deref()` on a reference in this situation does nothing

warning: call to `.deref()` on a reference in this situation does nothing
   --> src/check/constrain/generate/definition.rs:181:46
    |
181 |     let identifier = Identifier::try_from(var.deref())?.as_mutable(mutable);
    |                                              ^^^^^^^^
    |
    = note: the type `parse::ast::AST` does not implement `Deref`, so calling `deref` on `&parse::ast::AST` copies the reference, which does not do anything and can be removed
    = note: `#[warn(noop_method_call)]` on by default
help: remove this redundant call
    |
181 -     let identifier = Identifier::try_from(var.deref())?.as_mutable(mutable);
181 +     let identifier = Identifier::try_from(var)?.as_mutable(mutable);
    |
help: if you meant to clone `parse::ast::AST`, implement `Clone` for it
   --> src/parse/ast/mod.rs:14:1
    |
14  + #[derive(Clone)]
15  | pub struct AST {
    |

Check warning on line 201 in src/check/constrain/generate/call.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `vec!`

warning: useless use of `vec!`
   --> src/check/constrain/generate/call.rs:201:24
    |
201 |             let args = vec![last_inst.clone()].iter().chain(args).map(Expected::from).collect();
    |                        ^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[last_inst.clone()]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
    = note: `#[warn(clippy::useless_vec)]` on by default

Check warning on line 33 in src/io.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

file opened with `create`, but `truncate` behavior not defined

warning: file opened with `create`, but `truncate` behavior not defined
  --> src/io.rs:33:10
   |
33 |         .create(true)
   |          ^^^^^^^^^^^^- help: add: `.truncate(true)`
   |
   = help: if you intend to overwrite an existing file entirely, call `.truncate(true)`
   = help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)`
   = help: alternatively, use `.append(true)` to append to the file instead of overwriting it
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options
   = note: `#[warn(clippy::suspicious_open_options)]` on by default

Check warning on line 26 in src/parse/operation.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

doc list item without indentation

warning: doc list item without indentation
  --> src/parse/operation.rs:26:5
   |
26 | /// in not, is a, is not a
   |     ^
   |
   = help: if this is supposed to be its own paragraph, add a blank line
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
help: indent this line
   |
26 | ///    in not, is a, is not a
   |     +++

Check warning on line 56 in src/generate/name.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

accessing first element with `self.generics.get(0)`

warning: accessing first element with `self.generics.get(0)`
  --> src/generate/name.rs:56:28
   |
56 |                 let args = self.generics.get(0).cloned().unwrap_or_else(Name::empty);
   |                            ^^^^^^^^^^^^^^^^^^^^ help: try: `self.generics.first()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first

Check warning on line 143 in src/generate/convert/class.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `std::collections::hash_map::Values<'_, generate::ast::node::Core, (usize, generate::ast::node::Core)>`

warning: useless conversion to the same type: `std::collections::hash_map::Values<'_, generate::ast::node::Core, (usize, generate::ast::node::Core)>`
   --> src/generate/convert/class.rs:141:33
    |
141 |       let body_stmts: Vec<Core> = body_name_stmts
    |  _________________________________^
142 | |         .values()
143 | |         .into_iter()
    | |____________________^
    |
    = 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
help: consider removing `.into_iter()`
    |
141 ~     let body_stmts: Vec<Core> = body_name_stmts
142 +         .values()
    |

Check warning on line 424 in src/check/name/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of `Iterator::fold` on a type that implements `Try`

warning: usage of `Iterator::fold` on a type that implements `Try`
   --> src/check/name/mod.rs:420:27
    |
420 |           self.names.iter().fold(Ok(mapping), |acc, s_n| {
    |  ___________________________^
421 | |             other.names.iter().fold(acc, |acc, o_n| if let Ok(acc) = acc {
422 | |                 s_n.temp_map(&o_n.variant, acc, pos)
423 | |             } else { acc })
424 | |         })
    | |__________^ help: use `try_fold` instead: `try_fold(mapping, |acc, s_n| ...)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold
    = note: `#[warn(clippy::manual_try_fold)]` on by default

Check warning on line 163 in src/check/name/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

non-canonical implementation of `partial_cmp` on an `Ord` type

warning: non-canonical implementation of `partial_cmp` on an `Ord` type
   --> src/check/name/mod.rs:157:1
    |
157 | /  impl PartialOrd<Self> for Name {
158 | |      fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
    | | _____________________________________________________________-
159 | ||         let self_vec = self.names.iter().sorted();
160 | ||         let other_vec = other.names.iter().sorted();
161 | ||         self_vec.partial_cmp(other_vec)
162 | ||     }
    | ||_____- help: change this to: `{ Some(self.cmp(other)) }`
163 | |  }
    | |__^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl

Check warning on line 93 in src/check/name/true_name/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

doc list item without indentation

warning: doc list item without indentation
  --> src/check/name/true_name/mod.rs:93:9
   |
93 |     /// If self is not nullable, then super of other iff:
   |         ^
   |
   = help: if this is supposed to be its own paragraph, add a blank line
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
   = note: `#[warn(clippy::doc_lazy_continuation)]` on by default
help: indent this line
   |
93 |     ///   If self is not nullable, then super of other iff:
   |         ++

Check warning on line 44 in src/check/name/true_name/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

non-canonical implementation of `partial_cmp` on an `Ord` type

warning: non-canonical implementation of `partial_cmp` on an `Ord` type
  --> src/check/name/true_name/mod.rs:32:1
   |
32 | /  impl PartialOrd<Self> for TrueName {
33 | |      fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
   | | _____________________________________________________________-
34 | ||         if self.variant == other.variant {
35 | ||             if self.is_nullable == other.is_nullable {
36 | ||                 self.is_mutable.partial_cmp(&other.is_mutable)
...  ||
42 | ||         }
43 | ||     }
   | ||_____- help: change this to: `{ Some(self.cmp(other)) }`
44 | |  }
   | |__^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl
   = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default

Check warning on line 179 in src/check/name/string_name/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

accessing first element with `self.generics.get(0)`

warning: accessing first element with `self.generics.get(0)`
   --> src/check/name/string_name/mod.rs:179:28
    |
179 |                 let args = self.generics.get(0).expect("Unreachable");
    |                            ^^^^^^^^^^^^^^^^^^^^ help: try: `self.generics.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

Check warning on line 26 in src/check/constrain/unify/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `map_err` over `inspect_err`

warning: using `map_err` over `inspect_err`
  --> src/check/constrain/unify/mod.rs:26:89
   |
26 |             unify_link(&mut constraints.clone(), &mut finished, ctx, constraints.len()).map_err(|e| {
   |                                                                                         ^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect
   = note: `#[warn(clippy::manual_inspect)]` on by default
help: try
   |
26 ~             unify_link(&mut constraints.clone(), &mut finished, ctx, constraints.len()).inspect_err(|e| {
27 |                 trace!(
...
34 |                     }))
35 ~                 );
   |

Check warning on line 68 in src/check/constrain/generate/statement.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

if let can be simplified with `.unwrap_or_default()`

warning: if let can be simplified with `.unwrap_or_default()`
  --> src/check/constrain/generate/statement.rs:66:25
   |
66 | /                         if let Ok(result) = raise_class.has_parent(env_raise, ctx, pos) {
67 | |                             result
68 | |                         } else { false }
   | |________________________________________^ help: replace it with: `raise_class.has_parent(env_raise, ctx, pos).unwrap_or_default()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default
   = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default

Check warning on line 68 in src/check/constrain/generate/statement.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this pattern reimplements `Result::unwrap_or`

warning: this pattern reimplements `Result::unwrap_or`
  --> src/check/constrain/generate/statement.rs:66:25
   |
66 | /                         if let Ok(result) = raise_class.has_parent(env_raise, ctx, pos) {
67 | |                             result
68 | |                         } else { false }
   | |________________________________________^ help: replace with: `raise_class.has_parent(env_raise, ctx, pos).unwrap_or(false)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or
   = note: `#[warn(clippy::manual_unwrap_or)]` on by default

Check warning on line 13 in src/generate/convert/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `tup` is never read

warning: field `tup` is never read
  --> src/generate/convert/state.rs:13:9
   |
10 | pub struct State {
   |            ----- field in this struct
...
13 |     pub tup: usize,
   |         ^^^
   |
   = note: `State` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default