You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clippy warns on same_name_method because the generated code has two methods with the same name: one from a trait, another not from trait (get()/iter()).
$ cargo clippy -- -W clippy::same_name_method
Checking rustembed-clippy v0.1.0 (/home/Documents/src/rustembed-clippy)
warning: method's name is the same as an existing method in a trait
--> src/main.rs:3:10
|
3 | #[derive(RustEmbed)]
| ^^^^^^^^^
|
note: existing `get` defined here
--> src/main.rs:3:10
|
3 | #[derive(RustEmbed)]
| ^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_name_method
= note: requested on the command line with `-W clippy::same-name-method`
= note: this warning originates in the derive macro `RustEmbed` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: `rustembed-clippy` (bin "rustembed-clippy") generated 1 warning
Finished dev [unoptimized + debuginfo] target(s) in 0.17s
It seems like one option is to add #[allow(clippy::same_name_method)] to the generated code. Maybe there's another option where we can fold the generated code into one get/iter method.
The text was updated successfully, but these errors were encountered:
Unless we make a breaking change / major version, we can't remove the non-trait methods. I'd accept a PR that adds the allow attribute to the generated code.
Clippy warns on same_name_method because the generated code has two methods with the same name: one from a trait, another not from trait (
get()
/iter()
).I made a simple example to reproduce the issue: https://github.com/Zacho2/rustembed-clippy. This is basically the same as rust-embed/examples/basic.rs.
Example output from clippy:
It seems like one option is to add
#[allow(clippy::same_name_method)]
to the generated code. Maybe there's another option where we can fold the generated code into one get/iter method.The text was updated successfully, but these errors were encountered: