Skip to content

Restructure

Restructure #388

GitHub Actions / clippy succeeded Jun 14, 2024 in 1s

clippy

17 warnings

Details

Results

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

Versions

  • rustc 1.79.0 (129f3b996 2024-06-10)
  • cargo 1.79.0 (ffa9cf99a 2024-06-03)
  • clippy 0.1.79 (129f3b9 2024-06-10)

Annotations

Check warning on line 36 in src/type_collection.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
  --> src/type_collection.rs:36:29
   |
36 |             let dt = export(&mut type_map);
   |                             ^^^^^^^^^^^^^ help: change this to: `type_map`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `#[warn(clippy::needless_borrow)]` implied by `#[warn(clippy::all)]`

Check warning on line 17 in src/type_collection.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `impl` can be derived

warning: this `impl` can be derived
  --> src/type_collection.rs:11:1
   |
11 | / impl Default for TypeCollection {
12 | |     fn default() -> Self {
13 | |         Self {
14 | |             types: HashMap::new(),
15 | |         }
16 | |     }
17 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
   = note: `#[warn(clippy::derivable_impls)]` implied by `#[warn(clippy::all)]`
   = help: remove the manual implementation...
help: ...and instead derive it
   |
7  + #[derive(Default)]
8  | pub struct TypeCollection {
   |

Check warning on line 166 in src/type/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

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

warning: accessing first element with `generics.get(0)`
   --> src/type/impls.rs:165:17
    |
165 | /                 generics
166 | |                     .get(0)
    | |___________________________^ help: try: `generics.first()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first

Check warning on line 153 in src/type/impls.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

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

warning: accessing first element with `generics.get(0)`
   --> src/type/impls.rs:153:18
    |
153 |             ty = generics.get(0).cloned()
    |                  ^^^^^^^^^^^^^^^ help: try: `generics.first()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
    = note: `#[warn(clippy::get_first)]` implied by `#[warn(clippy::all)]`

Check warning on line 166 in src/lang/ts/mod.rs

See this annotation in the file changed.

@github-actions 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/mod.rs:166:5
    |
166 |     s.push_str(";");
    |     ^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `s.push(';')`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str

Check warning on line 159 in src/lang/ts/mod.rs

See this annotation in the file changed.

@github-actions 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/mod.rs:159:5
    |
159 |     s.push_str(")");
    |     ^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `s.push(')')`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str

Check warning on line 149 in src/lang/ts/mod.rs

See this annotation in the file changed.

@github-actions 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/mod.rs:149:5
    |
149 |     s.push_str("(");
    |     ^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `s.push('(')`
    |
    = 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 22 in src/datatype/reference.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary use of `get(&sid).is_none()`

warning: unnecessary use of `get(&sid).is_none()`
  --> src/datatype/reference.rs:22:21
   |
22 |     if type_map.map.get(&sid).is_none() {
   |        -------------^^^^^^^^^^^^^^^^^^^
   |        |
   |        help: replace it with: `!type_map.map.contains_key(&sid)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
   = note: `#[warn(clippy::unnecessary_get_then_check)]` implied by `#[warn(clippy::all)]`

Check warning on line 241 in src/internal.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> src/internal.rs:232:5
    |
232 | /     pub fn get_fn_datatype<TMarker, T: Function<TMarker>>(
233 | |         _: T,
234 | |         asyncness: bool,
235 | |         name: Cow<'static, str>,
...   |
240 | |         no_return_type: bool,
241 | |     ) -> FunctionDataType {
    | |_________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
    = note: `#[warn(clippy::too_many_arguments)]` implied by `#[warn(clippy::all)]`

Check warning on line 344 in src/internal/interop.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`panic` should not be present in production code

warning: `panic` should not be present in production code
   --> src/internal/interop.rs:344:32
    |
344 |         DataType::Result(_) => panic!("Specta v1 does not support Result types"),
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic

Check warning on line 44 in src/internal/interop.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`panic` should not be present in production code

warning: `panic` should not be present in production code
  --> src/internal/interop.rs:44:37
   |
44 |             LiteralType::char(_) => panic!("Specta v1 does not support char literals"),
   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic

Check warning on line 13 in src/internal/interop.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`panic` should not be present in production code

warning: `panic` should not be present in production code
  --> src/internal/interop.rs:13:30
   |
13 |         DataType::Unknown => panic!("Specta v1 does not support unknown types"),
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
note: the lint level is defined here
  --> src/lib.rs:3:43
   |
3  | #![warn(clippy::all, clippy::unwrap_used, clippy::panic)] // TODO: missing_docs
   |                                           ^^^^^^^^^^^^^

Check warning on line 34 in src/./docs.md

See this annotation in the file changed.

@github-actions github-actions / clippy

needless `fn main` in doctest

warning: needless `fn main` in doctest
  --> src/./docs.md:22:1
   |
22 | / use specta::{*, ts::*};
23 | |
24 | | #[derive(Type)]
25 | | pub struct MyCustomType {
...  |
33 | |     );
34 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
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_doctest_main)]` implied by `#[warn(clippy::all)]`

Check warning on line 66 in src/lang/ts/reserved_terms.rs

See this annotation in the file changed.

@github-actions 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] = &[
   |                  ^^^^^^^^^^^^^^^

Check warning on line 10 in src/lang/ts/context.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `0` is never read

warning: field `0` is never read
  --> src/lang/ts/context.rs:10:18
   |
10 |     TypeExtended(Cow<'static, str>, ImplLocation),
   |     ------------ ^^^^^^^^^^^^^^^^^
   |     |
   |     field in this variant
   |
   = note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
10 |     TypeExtended((), ImplLocation),
   |                  ~~

Check warning on line 112 in src/internal/interop.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `name`

warning: unused variable: `name`
   --> src/internal/interop.rs:112:32
    |
112 |                         .map(|(name, v)| match v.inner() {
    |                                ^^^^ help: if this is intentional, prefix it with an underscore: `_name`
    |
    = note: `#[warn(unused_variables)]` on by default

Check warning on line 33 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `selection::*`

warning: unused import: `selection::*`
  --> src/lib.rs:33:9
   |
33 | pub use selection::*;
   |         ^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default