Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement unnecesary_filter_map lint #3223

Merged
merged 9 commits into from Sep 30, 2018
Merged

Implement unnecesary_filter_map lint #3223

merged 9 commits into from Sep 30, 2018

Conversation

ghost
Copy link

@ghost ghost commented Sep 26, 2018

No description provided.

@ghost ghost added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 27, 2018
Copy link
Member

@phansch phansch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from separating the code, LGTM ✨

@@ -443,3 +443,17 @@ fn main() {
let opt = Some(0);
let _ = opt.unwrap();
}

/// Checks implementation of `UNNECESSARY_FILTER_MAP` lint
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to move these tests to their own tests/ui/unnecessary_filter_map.rs file so that the UI diffs are smaller. (#2038)

@@ -1398,6 +1424,144 @@ fn lint_unnecessary_fold(cx: &LateContext<'_, '_>, expr: &hir::Expr, fold_args:
};
}

mod unnecessary_filter_map {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it's possible to move this to its own file? methods.rs is already quite large.

@phansch phansch added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Sep 28, 2018
@ghost
Copy link
Author

ghost commented Sep 29, 2018

I totally broke the update_lints.py when I changed the modules. Please don't merge until I fix.

@ghost ghost changed the title Implement unnecesary_filter_map lint WIP: Implement unnecesary_filter_map lint Sep 29, 2018
@ghost ghost changed the title WIP: Implement unnecesary_filter_map lint Implement unnecesary_filter_map lint Sep 30, 2018
@ghost
Copy link
Author

ghost commented Sep 30, 2018

It's done.

@phansch phansch merged commit 9d0b79d into rust-lang:master Sep 30, 2018
@phansch
Copy link
Member

phansch commented Sep 30, 2018

Thanks!

@ghost ghost deleted the unnecessary_filter_map branch October 2, 2018 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant