Restructure #403
Annotations
13 errors and 44 warnings
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)
Process completed with exit code 101.
|
build (windows-latest)
The job was canceled because "macos-latest" failed.
|
build (windows-latest)
The operation was canceled.
|
build (ubuntu-latest)
The job was canceled because "macos-latest" failed.
|
build (ubuntu-latest)
The operation was canceled.
|
no function or associated item named `try_from_attrs` found for struct `data_type_from::attr::field::FieldAttr` in the current scope:
specta-datatype-from/src/data_type_from/attr/field.rs#L28
error[E0599]: no function or associated item named `try_from_attrs` found for struct `data_type_from::attr::field::FieldAttr` in the current scope
--> specta-datatype-from/src/data_type_from/attr/field.rs:28:15
|
8 | pub struct FieldAttr {
| -------------------- function or associated item `try_from_attrs` not found for this struct
...
28 | Self::try_from_attrs("specta", attrs, &mut result)?;
| ^^^^^^^^^^^^^^ function or associated item not found in `FieldAttr`
|
note: if you're trying to build a new `data_type_from::attr::field::FieldAttr`, consider using `data_type_from::attr::field::FieldAttr::from_attrs` which returns `std::result::Result<data_type_from::attr::field::FieldAttr, syn::Error>`
--> specta-datatype-from/src/data_type_from/attr/field.rs:26:5
|
26 | pub fn from_attrs(attrs: &mut Vec<Attribute>) -> Result<Self> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: there is an associated function `from_attrs` with a similar name
--> specta-datatype-from/src/data_type_from/attr/field.rs:26:5
|
26 | pub fn from_attrs(attrs: &mut Vec<Attribute>) -> Result<Self> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
no function or associated item named `try_from_attrs` found for struct `data_type_from::attr::container::ContainerAttr` in the current scope:
specta-datatype-from/src/data_type_from/attr/container.rs#L21
error[E0599]: no function or associated item named `try_from_attrs` found for struct `data_type_from::attr::container::ContainerAttr` in the current scope
--> specta-datatype-from/src/data_type_from/attr/container.rs:21:15
|
8 | pub struct ContainerAttr {
| ------------------------ function or associated item `try_from_attrs` not found for this struct
...
21 | Self::try_from_attrs("specta", attrs, &mut result)?;
| ^^^^^^^^^^^^^^ function or associated item not found in `ContainerAttr`
|
note: if you're trying to build a new `data_type_from::attr::container::ContainerAttr`, consider using `data_type_from::attr::container::ContainerAttr::from_attrs` which returns `std::result::Result<data_type_from::attr::container::ContainerAttr, syn::Error>`
--> specta-datatype-from/src/data_type_from/attr/container.rs:19:5
|
19 | pub fn from_attrs(attrs: &mut Vec<Attribute>) -> Result<Self> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: there is an associated function `from_attrs` with a similar name
--> specta-datatype-from/src/data_type_from/attr/container.rs:19:5
|
19 | pub fn from_attrs(attrs: &mut Vec<Attribute>) -> Result<Self> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
unresolved import `crate::utils`:
specta-datatype-from/src/data_type_from/mod.rs#L8
error[E0432]: unresolved import `crate::utils`
--> specta-datatype-from/src/data_type_from/mod.rs:8:12
|
8 | use crate::utils::{parse_attrs, then_option};
| ^^^^^ could not find `utils` in the crate root
|
unresolved import `crate::utils`:
specta-datatype-from/src/data_type_from/attr/field.rs#L5
error[E0432]: unresolved import `crate::utils`
--> specta-datatype-from/src/data_type_from/attr/field.rs:5:12
|
5 | use crate::utils::Attribute;
| ^^^^^ could not find `utils` in the crate root
|
unresolved import `crate::utils`:
specta-datatype-from/src/data_type_from/attr/container.rs#L5
error[E0432]: unresolved import `crate::utils`
--> specta-datatype-from/src/data_type_from/attr/container.rs:5:12
|
5 | use crate::utils::Attribute;
| ^^^^^ could not find `utils` in the crate root
|
clippy
Clippy had exited with the 101 exit code
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L241
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:241:29
|
241 | let generics = generics(&crate_ref, quote!(&[#(#generic_var_idents),*]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L192
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:192:17
|
192 | &crate_ref,
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L169
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:169:37
|
169 | let generics = generics(&crate_ref, quote!(&[]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L151
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:151:37
|
151 | let generics = generics(&crate_ref, quote!(&[#elem_var_ident]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L241
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:241:29
|
241 | let generics = generics(&crate_ref, quote!(&[#(#generic_var_idents),*]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L131
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:131:37
|
131 | let generics = generics(&crate_ref, quote!(&[#(#generic_var_idents),*]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L192
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:192:17
|
192 | &crate_ref,
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L169
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:169:37
|
169 | let generics = generics(&crate_ref, quote!(&[]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L151
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:151:37
|
151 | let generics = generics(&crate_ref, quote!(&[#elem_var_ident]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
specta-macros/src/type/generics.rs#L131
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> specta-macros/src/type/generics.rs:131:37
|
131 | let generics = generics(&crate_ref, quote!(&[#(#generic_var_idents),*]));
| ^^^^^^^^^^ help: change this to: `crate_ref`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
field assignment outside of initializer for an instance created with Default::default():
specta-macros/src/type/attr/variant.rs#L32
warning: field assignment outside of initializer for an instance created with Default::default()
--> specta-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
--> specta-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
|
field assignment outside of initializer for an instance created with Default::default():
specta-macros/src/type/attr/variant.rs#L32
warning: field assignment outside of initializer for an instance created with Default::default()
--> specta-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
--> specta-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:
specta-macros/src/utils.rs#L218
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:218:24
|
218 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-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)
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/utils.rs#L218
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:218:24
|
218 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-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():
specta-macros/src/type/attr/field.rs#L54
warning: field assignment outside of initializer for an instance created with Default::default()
--> specta-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
--> specta-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
|
field assignment outside of initializer for an instance created with Default::default():
specta-macros/src/type/attr/field.rs#L54
warning: field assignment outside of initializer for an instance created with Default::default()
--> specta-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
--> specta-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:
specta-macros/src/utils.rs#L218
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:218:24
|
218 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-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:
specta-macros/src/utils.rs#L218
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:218:24
|
218 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-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:
specta-macros/src/utils.rs#L218
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:218:24
|
218 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-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)
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/utils.rs#L218
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:218:24
|
218 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-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():
specta-macros/src/type/attr/container.rs#L54
warning: field assignment outside of initializer for an instance created with Default::default()
--> specta-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
--> specta-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
|
field assignment outside of initializer for an instance created with Default::default():
specta-macros/src/type/attr/container.rs#L54
warning: field assignment outside of initializer for an instance created with Default::default()
--> specta-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
--> specta-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:
specta-macros/src/utils.rs#L218
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:218:24
|
218 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-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)
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/utils.rs#L218
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-macros/src/utils.rs:218:24
|
218 | attrs: &mut Vec<crate::utils::Attribute>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [crate::utils::Attribute]`
|
::: specta-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:
specta-macros/src/type/attr/common.rs#L75
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> specta-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:
specta-macros/src/type/attr/common.rs#L75
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> specta-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:
specta-macros/src/type/attr/common.rs#L61
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> specta-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:
specta-macros/src/type/attr/common.rs#L61
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> specta-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:
specta-macros/src/type/attr/common.rs#L46
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> specta-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
|
called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead:
specta-macros/src/type/attr/common.rs#L46
warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead
--> specta-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:
specta-macros/src/type/attr/common.rs#L38
warning: calling `push_str()` using a single-character string literal
--> specta-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
|
calling `push_str()` using a single-character string literal:
specta-macros/src/type/attr/common.rs#L38
warning: calling `push_str()` using a single-character string literal
--> specta-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:
specta-macros/src/type/attr/common.rs#L32
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-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
= note: `#[warn(clippy::ptr_arg)]` on by default
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
specta-macros/src/type/attr/common.rs#L32
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> specta-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
= note: `#[warn(clippy::ptr_arg)]` on by default
|
unused import: `quote::ToTokens`:
specta-datatype-from/src/data_type_from/attr/field.rs#L2
warning: unused import: `quote::ToTokens`
--> specta-datatype-from/src/data_type_from/attr/field.rs:2:5
|
2 | use quote::ToTokens;
| ^^^^^^^^^^^^^^^
|
unused import: `quote::ToTokens`:
specta-datatype-from/src/data_type_from/attr/container.rs#L2
warning: unused import: `quote::ToTokens`
--> specta-datatype-from/src/data_type_from/attr/container.rs:2:5
|
2 | use quote::ToTokens;
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
redundant pattern matching, consider using `is_some()`:
specta-macros/src/specta.rs#L40
warning: redundant pattern matching, consider using `is_some()`
--> specta-macros/src/specta.rs:40:30
|
40 | let function_asyncness = match function.sig.asyncness {
| ______________________________^
41 | | Some(_) => true,
42 | | None => false,
43 | | };
| |_____^ 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
|
useless conversion to the same type: `proc_macro2::TokenStream`:
specta-macros/src/utils.rs#L206
warning: useless conversion to the same type: `proc_macro2::TokenStream`
--> specta-macros/src/utils.rs:206:55
|
206 | 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
|
function `then_option` is never used:
specta-macros/src/utils.rs#L307
warning: function `then_option` is never used
--> specta-macros/src/utils.rs:307:8
|
307 | pub fn then_option(condition: bool, inner: TokenStream) -> TokenStream {
| ^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
redundant pattern matching, consider using `is_some()`:
specta-macros/src/specta.rs#L40
warning: redundant pattern matching, consider using `is_some()`
--> specta-macros/src/specta.rs:40:30
|
40 | let function_asyncness = match function.sig.asyncness {
| ______________________________^
41 | | Some(_) => true,
42 | | None => false,
43 | | };
| |_____^ 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
|
useless conversion to the same type: `proc_macro2::TokenStream`:
specta-macros/src/utils.rs#L206
warning: useless conversion to the same type: `proc_macro2::TokenStream`
--> specta-macros/src/utils.rs:206:55
|
206 | 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
|
function `then_option` is never used:
specta-macros/src/utils.rs#L307
warning: function `then_option` is never used
--> specta-macros/src/utils.rs:307:8
|
307 | pub fn then_option(condition: bool, inner: TokenStream) -> TokenStream {
| ^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
clippy
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
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/
|