Skip to content

feat(erc721): add ERC721Enumerable extension (#67) #115

feat(erc721): add ERC721Enumerable extension (#67)

feat(erc721): add ERC721Enumerable extension (#67) #115

GitHub Actions / clippy failed May 29, 2024 in 1s

reviewdog [clippy] report

reported by reviewdog 🐶

Findings (1)

contracts/src/erc721/extensions/enumerable.rs|309 col 7| warning: unneeded sub cfg when there is only one condition
--> contracts/src/erc721/extensions/enumerable.rs:309:7
|
309 | #[cfg(all(test,
| ______^
310 | | // feature = "std"
311 | | ))]
| |
^ help: try: test
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
= note: #[warn(clippy::non_minimal_cfg)] on by default

Filtered Findings (13)

README.md|1 col 3| warning: item in documentation is missing backticks
--> contracts/src/../../README.md:1:3
|
1 | # OpenZeppelin Contracts for Stylus
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
note: the lint level is defined here
--> contracts/src/lib.rs:3:22
|
3 | #![warn(clippy::all, clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: #[warn(clippy::doc_markdown)] implied by #[warn(clippy::pedantic)]
help: try
|
1 | # OpenZeppelin Contracts for Stylus
| ~~~~~~~~~~~~~~
README.md|14 col 1| warning: item in documentation is missing backticks
--> contracts/src/../../README.md:14:1
|
14 | OpenZeppelin Contracts for Stylus exists thanks to its contributors. There are
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
14 | OpenZeppelin Contracts for Stylus exists thanks to its contributors. There are
| ~~~~~~~~~~~~~~
README.md|29 col 1| warning: item in documentation is missing backticks
--> contracts/src/../../README.md:29:1
|
29 | OpenZeppelin Contracts for Stylus is released under the MIT License.
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
29 | OpenZeppelin Contracts for Stylus is released under the MIT License.
| ~~~~~~~~~~~~~~
contracts/src/erc20/mod.rs|3 col 30| warning: item in documentation is missing backticks
--> contracts/src/erc20/mod.rs:3:30
|
3 | //! We have followed general OpenZeppelin Contracts guidelines: functions
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
3 | //! We have followed general OpenZeppelin Contracts guidelines: functions
| ~~~~~~~~~~~~~~
contracts/src/erc721/mod.rs|530 col 5| warning: this method could have a #[must_use] attribute
--> contracts/src/erc721/mod.rs:530:5
|
530 | pub fn owner_of_inner(&self, token_id: U256) -> Address {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub fn _owner_of_inner(&self, token_id: U256) -> Address
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
= note: #[warn(clippy::must_use_candidate)] implied by #[warn(clippy::pedantic)]
contracts/src/erc721/mod.rs|541 col 5| warning: this method could have a #[must_use] attribute
--> contracts/src/erc721/mod.rs:541:5
|
541 | pub fn get_approved_inner(&self, token_id: U256) -> Address {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub fn _get_approved_inner(&self, token_id: U256) -> Address
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
contracts/src/erc721/mod.rs|557 col 5| warning: this method could have a #[must_use] attribute
--> contracts/src/erc721/mod.rs:557:5
|
557 | / pub fn is_authorized(
558 | | &self,
559 | | owner: Address,
560 | | spender: Address,
561 | | token_id: U256,
562 | | ) -> bool {
| |
________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
help: add the attribute
|
557 ~ #[must_use] pub fn is_authorized(
558 + &self,
559 + owner: Address,
560 + spender: Address,
561 + token_id: U256,
562 ~ ) -> bool {
|
contracts/src/erc721/mod.rs|770 col 15| warning: this argument is passed by value, but not consumed in the function body
--> contracts/src/erc721/mod.rs:770:15
|
770 | data: Bytes,
| ^^^^^ help: consider taking a reference instead: &Bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
= note: #[warn(clippy::needless_pass_by_value)] implied by #[warn(clippy::pedantic)]
contracts/src/erc721/mod.rs|916 col 15| warning: this argument is passed by value, but not consumed in the function body
--> contracts/src/erc721/mod.rs:916:15
|
916 | data: Bytes,
| ^^^^^ help: consider taking a reference instead: &Bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
contracts/src/erc721/mod.rs|131 col 1| warning: missing documentation for a struct
--> contracts/src/erc721/mod.rs:131:1
|
131 | / sol_interface! {
132 | | /// [ERC721] token receiver interface.
133 | | ///
134 | | /// Interface for any contract that wants to support safeTransfers
135 | | /// from [ERC721] asset contracts.
136 | | interface IERC721Receiver {
| |_____________________________^
|
note: the lint level is defined here
--> contracts/src/lib.rs:2:9
|
2 | #![warn(missing_docs, unreachable_pub, rust_2021_compatibility)]
| ^^^^^^^^^^^^
= note: this warning originates in the macro sol_interface (in Nightly builds, run with -Z macro-backtrace for more info)
contracts/src/erc721/mod.rs|131 col 1| warning: missing documentation for a struct field
--> contracts/src/erc721/mod.rs:131:1
|
131 | / sol_interface! {
132 | | /// [ERC721] token receiver interface.
133 | | ///
134 | | /// Interface for any contract that wants to support safeTransfers
... |
151 | | }
152 | | }
| |
^
|
= note: this warning originates in the macro sol_interface (in Nightly builds, run with -Z macro-backtrace for more info)
contracts/src/erc721/mod.rs|131 col 1| warning: missing documentation for an associated function
--> contracts/src/erc721/mod.rs:131:1
|
131 | / sol_interface! {
132 | | /// [ERC721] token receiver interface.
133 | | ///
134 | | /// Interface for any contract that wants to support safeTransfers
... |
151 | | }
152 | | }
| |
^
|
= note: this warning originates in the macro sol_interface (in Nightly builds, run with -Z macro-backtrace for more info)
contracts/src/erc721/mod.rs|131 col 1| warning: missing documentation for a method
--> contracts/src/erc721/mod.rs:131:1
|
131 | / sol_interface! {
132 | | /// [ERC721] token receiver interface.
133 | | ///
134 | | /// Interface for any contract that wants to support safeTransfers
... |
151 | | }
152 | | }
| |
^
|
= note: this warning originates in the macro sol_interface (in Nightly builds, run with -Z macro-backtrace for more info)

Annotations

Check warning on line 309 in contracts/src/erc721/extensions/enumerable.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

[clippy] contracts/src/erc721/extensions/enumerable.rs#L309

warning: unneeded sub `cfg` when there is only one condition
   --> contracts/src/erc721/extensions/enumerable.rs:309:7
    |
309 |   #[cfg(all(test,
    |  _______^
310 | |         // feature = "std"
311 | | ))]
    | |_^ help: try: `test`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
    = note: `#[warn(clippy::non_minimal_cfg)]` on by default
Raw output
contracts/src/erc721/extensions/enumerable.rs:309:7:w:warning: unneeded sub `cfg` when there is only one condition
   --> contracts/src/erc721/extensions/enumerable.rs:309:7
    |
309 |   #[cfg(all(test,
    |  _______^
310 | |         // feature = "std"
311 | | ))]
    | |_^ help: try: `test`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
    = note: `#[warn(clippy::non_minimal_cfg)]` on by default


__END__