From 77e2155778e9700e4797acb8629ab52d19cd6b29 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 21 Jun 2016 13:32:34 +0200 Subject: [PATCH] update lints --- CHANGELOG.md | 3 +++ README.md | 5 ++++- clippy_lints/src/lib.rs | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c2f9e1a622..cbbd5497c79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -154,6 +154,9 @@ All notable changes to this project will be documented in this file. [`explicit_counter_loop`]: https://github.com/Manishearth/rust-clippy/wiki#explicit_counter_loop [`explicit_iter_loop`]: https://github.com/Manishearth/rust-clippy/wiki#explicit_iter_loop [`extend_from_slice`]: https://github.com/Manishearth/rust-clippy/wiki#extend_from_slice +[`filter_flat_map`]: https://github.com/Manishearth/rust-clippy/wiki#filter_flat_map +[`filter_map`]: https://github.com/Manishearth/rust-clippy/wiki#filter_map +[`filter_map_flat_map`]: https://github.com/Manishearth/rust-clippy/wiki#filter_map_flat_map [`filter_next`]: https://github.com/Manishearth/rust-clippy/wiki#filter_next [`float_arithmetic`]: https://github.com/Manishearth/rust-clippy/wiki#float_arithmetic [`float_cmp`]: https://github.com/Manishearth/rust-clippy/wiki#float_cmp diff --git a/README.md b/README.md index f410ff990d9..8f9d47f6ee9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Table of contents: ## Lints -There are 154 lints included in this crate: +There are 157 lints included in this crate: name | default | meaning ---------------------------------------------------------------------------------------------------------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -60,6 +60,9 @@ name [explicit_counter_loop](https://github.com/Manishearth/rust-clippy/wiki#explicit_counter_loop) | warn | for-looping with an explicit counter when `_.enumerate()` would do [explicit_iter_loop](https://github.com/Manishearth/rust-clippy/wiki#explicit_iter_loop) | warn | for-looping over `_.iter()` or `_.iter_mut()` when `&_` or `&mut _` would do [extend_from_slice](https://github.com/Manishearth/rust-clippy/wiki#extend_from_slice) | warn | `.extend_from_slice(_)` is a faster way to extend a Vec by a slice +[filter_flat_map](https://github.com/Manishearth/rust-clippy/wiki#filter_flat_map) | allow | using `filter(_).flat_map(_)`, which can be rewritten using just the flat_map +[filter_map](https://github.com/Manishearth/rust-clippy/wiki#filter_map) | allow | using `filter(_).map(_)`, which is more succinctly expressed as `.filter_map(_)` +[filter_map_flat_map](https://github.com/Manishearth/rust-clippy/wiki#filter_map_flat_map) | allow | using `filter_map(_).flat_map(_)`, which can be rewritten using just the flat_map [filter_next](https://github.com/Manishearth/rust-clippy/wiki#filter_next) | warn | using `filter(p).next()`, which is more succinctly expressed as `.find(p)` [float_arithmetic](https://github.com/Manishearth/rust-clippy/wiki#float_arithmetic) | allow | Any floating-point arithmetic statement [float_cmp](https://github.com/Manishearth/rust-clippy/wiki#float_cmp) | warn | using `==` or `!=` on float values (as floating-point operations usually involve rounding errors, it is always better to check for approximate equality within small bounds) diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index b68596f2535..a10ab8add0c 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -268,6 +268,9 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) { items_after_statements::ITEMS_AFTER_STATEMENTS, matches::SINGLE_MATCH_ELSE, mem_forget::MEM_FORGET, + methods::FILTER_FLAT_MAP, + methods::FILTER_MAP, + methods::FILTER_MAP_FLAT_MAP, methods::OPTION_UNWRAP_USED, methods::RESULT_UNWRAP_USED, methods::WRONG_PUB_SELF_CONVENTION,