6

Github match_single_binding: Fix invalid suggestion when match scrutinee has sid...

 2 years ago
source link: https://github.com/rust-lang/rust-clippy/pull/7095
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Copy link

Contributor

Y-Nak commented on Apr 16

edited

fixes #7094

changelog: match_single_binding: Fix invalid suggestion when match scrutinee has side effects


Expr::can_have_side_effects is used to determine the scrutinee has side effects, while this method is a little bit conservative for our use case. But I'd like to use it to avoid reimplementation of the method and too much heuristics. If you think this is problematic, then I'll implement a custom visitor to address it.


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK