yew icon indicating copy to clipboard operation
yew copied to clipboard

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

Open Madoshakalaka opened this issue 1 year ago • 2 comments

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:

  • Yew version: v0.21
  • Rust version: nightly

Madoshakalaka avatar Aug 10 '24 10:08 Madoshakalaka

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

Madoshakalaka avatar Aug 10 '24 10:08 Madoshakalaka

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

ranile avatar Aug 12 '24 14:08 ranile