Restructure #403
clippy
5 errors, 42 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 5 |
Warning | 42 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.79.0 (129f3b996 2024-06-10)
- cargo 1.79.0 (ffa9cf99a 2024-06-03)
- clippy 0.1.79 (129f3b9 2024-06-10)
Annotations
Check warning on line 241 in specta-macros/src/type/generics.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
--> 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
Check failure on line 28 in specta-datatype-from/src/data_type_from/attr/field.rs
github-actions / clippy
no function or associated item named `try_from_attrs` found for struct `data_type_from::attr::field::FieldAttr` in the current scope
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> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 192 in specta-macros/src/type/generics.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
--> 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
Check warning on line 169 in specta-macros/src/type/generics.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
--> 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
Check warning on line 151 in specta-macros/src/type/generics.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
--> 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
Check warning on line 241 in specta-macros/src/type/generics.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
--> 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
Check warning on line 131 in specta-macros/src/type/generics.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
--> 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
Check warning on line 192 in specta-macros/src/type/generics.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
--> 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
Check warning on line 169 in specta-macros/src/type/generics.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
--> 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
Check warning on line 151 in specta-macros/src/type/generics.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
--> 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
Check warning on line 131 in specta-macros/src/type/generics.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
--> 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
Check failure on line 21 in specta-datatype-from/src/data_type_from/attr/container.rs
github-actions / clippy
no function or associated item named `try_from_attrs` found for struct `data_type_from::attr::container::ContainerAttr` in the current scope
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> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 32 in specta-macros/src/type/attr/variant.rs
github-actions / clippy
field assignment outside of initializer for an instance created with Default::default()
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
Check warning on line 32 in specta-macros/src/type/attr/variant.rs
github-actions / clippy
field assignment outside of initializer for an instance created with Default::default()
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
Check warning on line 218 in specta-macros/src/utils.rs
github-actions / clippy
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
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)
Check warning on line 218 in specta-macros/src/utils.rs
github-actions / clippy
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
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)
Check warning on line 54 in specta-macros/src/type/attr/field.rs
github-actions / clippy
field assignment outside of initializer for an instance created with Default::default()
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
Check warning on line 54 in specta-macros/src/type/attr/field.rs
github-actions / clippy
field assignment outside of initializer for an instance created with Default::default()
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
Check warning on line 218 in specta-macros/src/utils.rs
github-actions / clippy
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
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)
Check warning on line 218 in specta-macros/src/utils.rs
github-actions / clippy
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
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)
Check warning on line 218 in specta-macros/src/utils.rs
github-actions / clippy
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
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)
Check warning on line 218 in specta-macros/src/utils.rs
github-actions / clippy
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
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)
Check warning on line 54 in specta-macros/src/type/attr/container.rs
github-actions / clippy
field assignment outside of initializer for an instance created with Default::default()
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
Check warning on line 54 in specta-macros/src/type/attr/container.rs
github-actions / clippy
field assignment outside of initializer for an instance created with Default::default()
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
Check warning on line 218 in specta-macros/src/utils.rs
github-actions / clippy
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
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)