function + result #80
Annotations
11 warnings
useless use of `format!`:
src/lang/ts/mod.rs#L349
warning: useless use of `format!`
--> src/lang/ts/mod.rs:349:25
|
349 | format!("{sanitised_name}")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `sanitised_name.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` implied by `#[warn(clippy::all)]`
|
single-character string constant used as pattern:
src/lang/ts/mod.rs#L207
warning: single-character string constant used as pattern
--> src/lang/ts/mod.rs:207:50
|
207 | if dt.contains(' ') && !dt.ends_with("}") {
| ^^^ 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)]`
|
use of `.then_some(..).unwrap_or(..)` can be written more clearly with `if .. else ..`:
src/lang/ts/mod.rs#L195
warning: use of `.then_some(..).unwrap_or(..)` can be written more clearly with `if .. else ..`
--> src/lang/ts/mod.rs:195:27
|
195 | let divider = is_enum.then_some(" in").unwrap_or(":");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `if is_enum { " in" } else { ":" }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#obfuscated_if_else
= note: `#[warn(clippy::obfuscated_if_else)]` implied by `#[warn(clippy::all)]`
|
match expression looks like `matches!` macro:
src/lang/ts/mod.rs#L187
warning: match expression looks like `matches!` macro
--> src/lang/ts/mod.rs:187:21
|
187 | / match typ.item {
188 | | NamedDataTypeItem::Enum(_) => true,
189 | | _ => false,
190 | | }
| |_____________________^ help: try this: `matches!(typ.item, NamedDataTypeItem::Enum(_))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
|
use of `expect` followed by a function call:
src/lang/ts/mod.rs#L183
warning: use of `expect` followed by a function call
--> src/lang/ts/mod.rs:183:26
|
183 | .expect(&format!("Type {} not found!", r.name))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Type {} not found!", r.name))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
|
use of `expect` followed by a function call:
src/lang/ts/mod.rs#L185
warning: use of `expect` followed by a function call
--> src/lang/ts/mod.rs:185:26
|
185 | .expect(&format!("Type {} has no value!", r.name));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `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#expect_fun_call
= note: `#[warn(clippy::expect_fun_call)]` implied by `#[warn(clippy::all)]`
|
match expression looks like `matches!` macro:
src/lang/ts/mod.rs#L176
warning: match expression looks like `matches!` macro
--> src/lang/ts/mod.rs:176:40
|
176 | DataType::Named(dt) => match dt.item {
| ________________________________________^
177 | | NamedDataTypeItem::Enum(_) => true,
178 | | _ => false,
179 | | },
| |_________________^ help: try this: `matches!(dt.item, NamedDataTypeItem::Enum(_))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
= note: `#[warn(clippy::match_like_matches_macro)]` implied by `#[warn(clippy::all)]`
|
missing documentation for a variant:
src/functions/result.rs#L8
warning: missing documentation for a variant
--> src/functions/result.rs:8:5
|
8 | Result(DataType, DataType),
| ^^^^^^
|
missing documentation for a variant:
src/functions/result.rs#L7
warning: missing documentation for a variant
--> src/functions/result.rs:7:5
|
7 | Value(DataType),
| ^^^^^
|
missing documentation for an enum:
src/functions/result.rs#L6
warning: missing documentation for an enum
--> src/functions/result.rs:6:1
|
6 | pub enum SpectaFunctionResultVariant {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> src/lib.rs:58:58
|
58 | #![warn(clippy::all, clippy::unwrap_used, clippy::panic, missing_docs)]
| ^^^^^^^^^^^^
|
you seem to want to iterate on a map's values:
src/export.rs#L62
warning: you seem to want to iterate on a map's values
--> src/export.rs:62:21
|
62 | for (_, typ) in &types {
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map
note: the lint level is defined here
--> src/lib.rs:58:9
|
58 | #![warn(clippy::all, clippy::unwrap_used, clippy::panic, missing_docs)]
| ^^^^^^^^^^^
= note: `#[warn(clippy::for_kv_map)]` implied by `#[warn(clippy::all)]`
help: use the corresponding method
|
62 | for typ in types.values() {
| ~~~ ~~~~~~~~~~~~~~
|