Skip to content

Datatype Copy Rust's Structure #190

Datatype Copy Rust's Structure

Datatype Copy Rust's Structure #190

GitHub Actions / clippy succeeded Aug 31, 2023 in 1s

clippy

73 warnings

Details

Results

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

Versions

  • rustc 1.72.0 (5680fa18f 2023-08-23)
  • cargo 1.72.0 (103a7ff2e 2023-08-15)
  • clippy 0.1.72 (5680fa1 2023-08-23)

Annotations

Check warning on line 116 in src/type/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for an associated constant

warning: missing documentation for an associated constant
   --> src/type/mod.rs:116:5
    |
116 |     const IMPL_LOCATION: ImplLocation;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 115 in src/type/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for an associated constant

warning: missing documentation for an associated constant
   --> src/type/mod.rs:115:5
    |
115 |     const SID: SpectaID;
    |     ^^^^^^^^^^^^^^^^^^^

Check warning on line 27 in src/type/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/type/mod.rs:27:5
   |
27 |     InvalidType(ImplLocation, &'static str),
   |     ^^^^^^^^^^^

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

See this annotation in the file changed.

@github-actions github-actions / clippy

length comparison to zero

warning: length comparison to zero
   --> src/lang/ts/mod.rs:295:16
    |
295 |             if s.fields.len() == 0 {
    |                ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.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 292 in src/lang/ts/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> src/lang/ts/mod.rs:292:29
    |
292 |         StructType::Unit => return Ok("null".into()),
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = note: `#[warn(clippy::needless_return)]` implied by `#[warn(clippy::all)]`
help: remove `return`
    |
292 |         StructType::Unit => Ok("null".into()),
    |                             ~~~~~~~~~~~~~~~~~

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

See this annotation in the file changed.

@github-actions github-actions / clippy

this match could be written as a `let` statement

warning: this match could be written as a `let` statement
   --> src/lang/ts/mod.rs:270:5
    |
270 | /     match tuple {
271 | |         TupleType { fields, .. } => match &fields[..] {
272 | |             [] => Ok(empty_tuple_fallback.to_string()),
273 | |             [ty] => datatype_inner(ctx, ty, type_map, "null"),
...   |
281 | |         },
282 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding
help: consider using a `let` statement
    |
270 ~     let TupleType { fields, .. } = tuple;
271 +     match &fields[..] {
272 +         [] => Ok(empty_tuple_fallback.to_string()),
273 +         [ty] => datatype_inner(ctx, ty, type_map, "null"),
274 +         tys => Ok(format!(
275 +             "[{}]",
276 +             tys.iter()
277 +                 .map(|v| datatype_inner(ctx.clone(), v, type_map, "null"))
278 +                 .collect::<Result<Vec<_>>>()?
279 +                 .join(", ")
280 +         )),
281 +     }
    |

Check warning on line 202 in src/lang/ts/mod.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/lang/ts/mod.rs:202:44
    |
202 |                         .unwrap_or_else(|| panic!("Type {} has no value!", r.name()));
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic

Check warning on line 200 in src/lang/ts/mod.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/lang/ts/mod.rs:200:44
    |
200 |                         .unwrap_or_else(|| panic!("Type {} not found!", r.name()))
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = 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:58:43
    |
58  | #![warn(clippy::all, clippy::unwrap_used, clippy::panic, missing_docs)]
    |                                           ^^^^^^^^^^^^^

Check warning on line 48 in src/lang/ts/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/lang/ts/error.rs:48:5
   |
48 |     Other(ExportPath, String),
   |     ^^^^^

Check warning on line 46 in src/lang/ts/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/lang/ts/error.rs:46:5
   |
46 |     Io(#[from] std::io::Error),
   |     ^^

Check warning on line 44 in src/lang/ts/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/lang/ts/error.rs:44:5
   |
44 |     SpectaExportError(#[from] ExportError),
   |     ^^^^^^^^^^^^^^^^^

Check warning on line 42 in src/lang/ts/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/lang/ts/error.rs:42:5
   |
42 |     DuplicateTypeName(Cow<'static, str>, ImplLocation, ImplLocation),
   |     ^^^^^^^^^^^^^^^^^

Check warning on line 40 in src/lang/ts/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/lang/ts/error.rs:40:5
   |
40 |     InvalidTagging(ExportPath),
   |     ^^^^^^^^^^^^^^

Check warning on line 38 in src/lang/ts/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/lang/ts/error.rs:38:5
   |
38 |     ForbiddenName(NamedLocation, ExportPath, &'static str),
   |     ^^^^^^^^^^^^^

Check warning on line 36 in src/lang/ts/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/lang/ts/error.rs:36:5
   |
36 |     UnableToTagUnnamedType(ExportPath),
   |     ^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 34 in src/lang/ts/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a variant

warning: missing documentation for a variant
  --> src/lang/ts/error.rs:34:5
   |
34 |     BigIntForbidden(ExportPath),
   |     ^^^^^^^^^^^^^^^

Check warning on line 20 in src/export/ts.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `export::export::TypesIter`

warning: useless conversion to the same type: `export::export::TypesIter`
  --> src/export/ts.rs:19:17
   |
19 |       let types = get_types()?
   |  _________________^
20 | |         .into_iter()
   | |____________________^ help: consider removing `.into_iter()`: `get_types()?`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
   = note: `#[warn(clippy::useless_conversion)]` implied by `#[warn(clippy::all)]`

Check warning on line 1 in src/export/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

module has the same name as its containing module

warning: module has the same name as its containing module
 --> src/export/mod.rs:1:1
  |
1 | mod export;
  | ^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
  = note: `#[warn(clippy::module_inception)]` implied by `#[warn(clippy::all)]`

Check warning on line 88 in src/datatype/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a method

warning: missing documentation for a method
  --> src/datatype/mod.rs:88:5
   |
88 |     pub fn generics(&self) -> impl Iterator<Item = &DataType> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 84 in src/datatype/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a method

warning: missing documentation for a method
  --> src/datatype/mod.rs:84:5
   |
84 |     pub fn sid(&self) -> SpectaID {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 80 in src/datatype/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a method

warning: missing documentation for a method
  --> src/datatype/mod.rs:80:5
   |
80 |     pub fn name(&self) -> &Cow<'static, str> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 38 in src/datatype/tuple.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a method

warning: missing documentation for a method
  --> src/datatype/tuple.rs:38:5
   |
38 |     pub fn generics(&self) -> impl Iterator<Item = &GenericType> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 34 in src/datatype/tuple.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a method

warning: missing documentation for a method
  --> src/datatype/tuple.rs:34:5
   |
34 |     pub fn fields(&self) -> impl Iterator<Item = &DataType> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 115 in src/datatype/struct.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a method

warning: missing documentation for a method
   --> src/datatype/struct.rs:115:5
    |
115 |     pub fn tag(&self) -> Option<&Cow<'static, str>> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 96 in src/datatype/struct.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a method

warning: missing documentation for a method
  --> src/datatype/struct.rs:96:5
   |
96 |     pub fn fields(&self) -> Vec<StructField> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^