mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
update lints
This commit is contained in:
parent
4e52852146
commit
77e2155778
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user