Datatype Copy Rust's Structure #191
clippy
78 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 78 |
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
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
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
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 359 in src/lang/ts/mod.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/mod.rs:359:68
|
359 | ... let typ = struct_unnamed_datatype(ctx, &tuple, type_map, "[]")?;
| ^^^^^^ help: change this to: `tuple`
|
= 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 294 in src/lang/ts/mod.rs
github-actions / clippy
length comparison to zero
warning: length comparison to zero
--> src/lang/ts/mod.rs:294:16
|
294 | 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 291 in src/lang/ts/mod.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/lang/ts/mod.rs:291:29
|
291 | 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`
|
291 | StructType::Unit => Ok("null".into()),
| ~~~~~~~~~~~~~~~~~
Check warning on line 281 in src/lang/ts/mod.rs
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:269:5
|
269 | / match tuple {
270 | | TupleType { fields, .. } => match &fields[..] {
271 | | [] => Ok(empty_tuple_fallback.to_string()),
272 | | [ty] => datatype_inner(ctx, ty, type_map, "null"),
... |
280 | | },
281 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding
= note: `#[warn(clippy::match_single_binding)]` implied by `#[warn(clippy::all)]`
help: consider using a `let` statement
|
269 ~ let TupleType { fields, .. } = tuple;
270 + match &fields[..] {
271 + [] => Ok(empty_tuple_fallback.to_string()),
272 + [ty] => datatype_inner(ctx, ty, type_map, "null"),
273 + tys => Ok(format!(
274 + "[{}]",
275 + tys.iter()
276 + .map(|v| datatype_inner(ctx.clone(), v, type_map, "null"))
277 + .collect::<Result<Vec<_>>>()?
278 + .join(", ")
279 + )),
280 + }
|
Check warning on line 179 in src/lang/ts/mod.rs
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:179:44
|
179 | .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 177 in src/lang/ts/mod.rs
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:177:44
|
177 | .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
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
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
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
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
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
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
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
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
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
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 98 in src/datatype/mod.rs
github-actions / clippy
missing documentation for a method
warning: missing documentation for a method
--> src/datatype/mod.rs:98:5
|
98 | pub fn generics(&self) -> impl Iterator<Item = &DataType> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 94 in src/datatype/mod.rs
github-actions / clippy
missing documentation for a method
warning: missing documentation for a method
--> src/datatype/mod.rs:94:5
|
94 | pub fn sid(&self) -> SpectaID {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 90 in src/datatype/mod.rs
github-actions / clippy
missing documentation for a method
warning: missing documentation for a method
--> src/datatype/mod.rs:90:5
|
90 | pub fn name(&self) -> &Cow<'static, str> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 64 in src/datatype/mod.rs
github-actions / clippy
missing documentation for a method
warning: missing documentation for a method
--> src/datatype/mod.rs:64:5
|
64 | pub fn generics(&self) -> Option<Vec<GenericType>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 33 in src/datatype/tuple.rs
github-actions / clippy
missing documentation for a method
warning: missing documentation for a method
--> src/datatype/tuple.rs:33:5
|
33 | pub fn fields(&self) -> impl Iterator<Item = &DataType> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 144 in src/datatype/struct.rs
github-actions / clippy
missing documentation for a method
warning: missing documentation for a method
--> src/datatype/struct.rs:144:5
|
144 | pub fn tag(&self) -> Option<&Cow<'static, str>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^