yewstack / yew

Rust / Wasm framework for creating reliable and efficient web applications
https://yew.rs
Apache License 2.0
30.52k stars 1.42k forks source link

generic #[hook] function gives `bound is defined in more than one place` warning #3708

Open Madoshakalaka opened 1 month ago

Madoshakalaka commented 1 month ago

Problem code like this

#[hook]
pub fn use_generic<N: PartialEq>(){

}

will emit warning:

warning: bound is defined in more than one place
   --> frontend/src/components/shiori.rs:560:20
    |
560 | pub fn use_generic<N: PartialEq>(){
    |                    ^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index
.html#multiple_bound_locations
    = note: `#[warn(clippy::multiple_bound_locations)]` on by default

see: https://rust-lang.github.io/rust-clippy/master/index.html#multiple_bound_locations

Environment:

Madoshakalaka commented 1 month ago

This is one of the default clippy warnings, not cargo check

ranile commented 1 month ago

This is a clippy warning. We should suppress it in the generated code though. I'll be happy to look at any PR suppressing it