Specta CLI #334
Annotations
9 errors and 20 warnings
build (ubuntu-latest)
ENOENT: no such file or directory, opendir '/home/runner/work/specta/specta/target/tests/target'
|
build (ubuntu-latest)
Error: ENOENT: no such file or directory, opendir '/home/runner/work/specta/specta/target/tests/target'
|
build (ubuntu-latest)
ENOENT: no such file or directory, opendir '/home/runner/work/specta/specta/target/tests/target'
|
build (ubuntu-latest)
Error: ENOENT: no such file or directory, opendir '/home/runner/work/specta/specta/target/tests/target'
|
build (macos-latest)
ENOENT: no such file or directory, opendir '/Users/runner/work/specta/specta/target/tests/target'
|
build (macos-latest)
Error: ENOENT: no such file or directory, opendir '/Users/runner/work/specta/specta/target/tests/target'
|
build (macos-latest)
ENOENT: no such file or directory, opendir '/Users/runner/work/specta/specta/target/tests/target'
|
build (macos-latest)
Error: ENOENT: no such file or directory, opendir '/Users/runner/work/specta/specta/target/tests/target'
|
build (windows-latest)
Process completed with exit code 1.
|
this function has too many arguments (8/7):
src/internal.rs#L229
warning: this function has too many arguments (8/7)
--> src/internal.rs:229:5
|
229 | / pub fn get_fn_datatype<TMarker, T: SpectaFunction<TMarker>>(
230 | | _: T,
231 | | asyncness: bool,
232 | | name: Cow<'static, str>,
... |
237 | | no_return_type: bool,
238 | | ) -> FunctionDataType {
| |_________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
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::too_many_arguments)]` implied by `#[warn(clippy::all)]`
|
constant `RESERVED_IDENTS` is never used:
src/lang/ts/reserved_terms.rs#L66
warning: constant `RESERVED_IDENTS` is never used
--> src/lang/ts/reserved_terms.rs:66:18
|
66 | pub(crate) const RESERVED_IDENTS: &[&str] = &[
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
field assignment outside of initializer for an instance created with Default::default():
macros/src/type/attr/variant.rs#L32
warning: field assignment outside of initializer for an instance created with Default::default()
--> macros/src/type/attr/variant.rs:32:9
|
32 | result.common = CommonAttr::from_attrs(attrs)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `r#type::attr::variant::VariantAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments
--> macros/src/type/attr/variant.rs:31:9
|
31 | let mut result = Self::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
macros/src/utils.rs#L216
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> macros/src/utils.rs:216:24
|
216 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: macros/src/type/attr/variant.rs:18:1
|
18 | / impl_parse! {
19 | | VariantAttr(attr, out) {
20 | | "rename_all" => out.rename_all = out.rename_all.take().or(Some(attr.parse_inflection()?)),
21 | | "rename" => out.rename = out.rename.take().or(Some(attr.parse_string()?.to_token_stream())),
... |
26 | | }
27 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
field assignment outside of initializer for an instance created with Default::default():
macros/src/type/attr/field.rs#L54
warning: field assignment outside of initializer for an instance created with Default::default()
--> macros/src/type/attr/field.rs:54:9
|
54 | result.common = CommonAttr::from_attrs(attrs)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `r#type::attr::field::FieldAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments
--> macros/src/type/attr/field.rs:53:9
|
53 | let mut result = Self::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
macros/src/utils.rs#L216
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> macros/src/utils.rs:216:24
|
216 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: macros/src/type/attr/field.rs:20:1
|
20 | / impl_parse! {
21 | | FieldAttr(attr, out) {
22 | | "rename" => {
23 | | let attr = attr.parse_string()?;
... |
48 | | }
49 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
macros/src/utils.rs#L216
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> macros/src/utils.rs:216:24
|
216 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: macros/src/type/attr/enum.rs:25:1
|
25 | / impl_parse! {
26 | | EnumAttr(attr, out) {
27 | | // "tag" was already passed in the container so we don't need to do anything here
28 | | "content" => out.content = out.content.take().or(Some(attr.parse_string()?)),
... |
31 | | }
32 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
field assignment outside of initializer for an instance created with Default::default():
macros/src/type/attr/container.rs#L54
warning: field assignment outside of initializer for an instance created with Default::default()
--> macros/src/type/attr/container.rs:54:9
|
54 | result.common = CommonAttr::from_attrs(attrs)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `r#type::attr::container::ContainerAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments
--> macros/src/type/attr/container.rs:53:9
|
53 | let mut result = Self::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
= note: `#[warn(clippy::field_reassign_with_default)]` on by default
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
macros/src/utils.rs#L216
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> macros/src/utils.rs:216:24
|
216 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: macros/src/type/attr/container.rs:24:1
|
24 | / impl_parse! {
25 | | ContainerAttr(attr, out) {
26 | | "rename_all" => out.rename_all = out.rename_all.take().or(Some(attr.parse_inflection()?)),
27 | | "rename" => {
... |
48 | | }
49 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead:
macros/src/type/attr/common.rs#L75
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> macros/src/type/attr/common.rs:75:32
|
75 | let note = attr
| ________________________________^
76 | | .iter()
77 | | .filter(|attr| attr.key == "note")
78 | | .next()
| |_______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next
help: try
|
75 ~ let note = attr
76 + .iter().find(|attr| attr.key == "note")
|
|
called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead:
macros/src/type/attr/common.rs#L61
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> macros/src/type/attr/common.rs:61:33
|
61 | let since = attr
| _________________________________^
62 | | .iter()
63 | | .filter(|attr| attr.key == "since")
64 | | .next()
| |_______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next
help: try
|
61 ~ let since = attr
62 + .iter().find(|attr| attr.key == "since")
|
|
called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead:
macros/src/type/attr/common.rs#L46
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> macros/src/type/attr/common.rs:46:35
|
46 | if let Some(attr_value) = attrs.iter().filter(|attr| attr.key == "deprecated").next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `attrs.iter().find(|attr| attr.key == "deprecated")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next
= note: `#[warn(clippy::filter_next)]` on by default
|
calling `push_str()` using a single-character string literal:
macros/src/type/attr/common.rs#L38
warning: calling `push_str()` using a single-character string literal
--> macros/src/type/attr/common.rs:38:21
|
38 | s.push_str("\n");
| ^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `s.push('\n')`
|
= 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)]` on by default
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
macros/src/type/attr/common.rs#L32
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> macros/src/type/attr/common.rs:32:30
|
32 | pub fn from_attrs(attrs: &mut Vec<Attribute>) -> Result<Self> {
| ^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [Attribute]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
|
redundant pattern matching, consider using `is_some()`:
macros/src/specta.rs#L21
warning: redundant pattern matching, consider using `is_some()`
--> macros/src/specta.rs:21:30
|
21 | let function_asyncness = match function.sig.asyncness {
| ______________________________^
22 | | Some(_) => true,
23 | | None => false,
24 | | };
| |_____^ help: try: `function.sig.asyncness.is_some()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
= note: `#[warn(clippy::redundant_pattern_matching)]` on by default
|
length comparison to zero:
macros/src/data_type_from/mod.rs#L24
warning: length comparison to zero
--> macros/src/data_type_from/mod.rs:24:8
|
24 | if generics.params.len() > 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!generics.params.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` on by default
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
macros/src/utils.rs#L216
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> macros/src/utils.rs:216:24
|
216 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: macros/src/data_type_from/attr/field.rs:13:1
|
13 | / impl_parse! {
14 | | FieldAttr(attr, out) {
15 | | "skip" => out.skip = true,
16 | | "rename" => {
... |
22 | | }
23 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
macros/src/utils.rs#L216
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> macros/src/utils.rs:216:24
|
216 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: macros/src/data_type_from/attr/container.rs:12:1
|
12 | / impl_parse! {
13 | | ContainerAttr(attr, out) {
14 | | "crate" => out.crate_name = out.crate_name.take().or(Some(attr.parse_path()?.into_token_stream())),
15 | | }
16 | | }
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
= note: this warning originates in the macro `impl_parse` (in Nightly builds, run with -Z macro-backtrace for more info)
|
useless conversion to the same type: `proc_macro2::TokenStream`:
macros/src/utils.rs#L204
warning: useless conversion to the same type: `proc_macro2::TokenStream`
--> macros/src/utils.rs:204:55
|
204 | let attr = syn::parse::Parser::parse2(parser, attr.tokens.clone().into())?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `attr.tokens.clone()`
|
= 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
|
clippy
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|