Closed
Description
in servo, if let &DisplayItem::StackingContextClass(ref stacking_context) = kid {
triggers match_ref_pats.
complete output:
/servo/components/gfx/paint_task.rs:519:17: 527:18 warning: instead of prefixing all patterns with `&`, you can dereference the expression: `if let ... = *kid {`, #[warn(match_ref_pats)] on by default
/servo/components/gfx/paint_task.rs:519 if let &DisplayItem::StackingContextClass(ref stacking_context) = kid {
/servo/components/gfx/paint_task.rs:520 build_from_stacking_context(properties,
/servo/components/gfx/paint_task.rs:521 &stacking_context,
/servo/components/gfx/paint_task.rs:522 &parent_origin,
/servo/components/gfx/paint_task.rs:523 &transform,
/servo/components/gfx/paint_task.rs:524 &perspective,
...
/servo/components/gfx/paint_task.rs:519:17: 527:18 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#match_ref_pats
also, match-patterns where only one arm does the dereferencing also triggers it:
/servo/components/script/dom/htmlanchorelement.rs:62:9: 65:10 warning: instead of prefixing all patterns with `&`, you can dereference the expression: `match *name { ...`, #[warn(match_ref_pats)] on by default
/servo/components/script/dom/htmlanchorelement.rs:62 match name {
/servo/components/script/dom/htmlanchorelement.rs:63 &atom!("rel") => AttrValue::from_serialized_tokenlist(value),
/servo/components/script/dom/htmlanchorelement.rs:64 _ => self.super_type().unwrap().parse_plain_attribute(name, value),
/servo/components/script/dom/htmlanchorelement.rs:65 }
/servo/components/script/dom/htmlanchorelement.rs:62:9: 65:10 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#match_ref_pats
Metadata
Metadata
Assignees
Labels
No labels