Jane Lusby
14feb3670f
Lint for chaining flatten after map
...
This change adds a lint to check for instances of `map(..).flatten()`
that can be trivially shortened to `flat_map(..)`
Closes #3196
2018-09-24 14:29:16 -07:00
Michael Wright
ab71f08663
Fix single_char_pattern crash ( #3204 )
...
This commit fixes the crash by removing constant checking from the lint.
Closes #3204 .
2018-09-24 08:33:57 +02:00
Philipp Krones
bc6d85ceaf
Merge pull request #3207 from mikerite/fix-3206
...
Fix double_parens false positive
2018-09-23 18:24:27 +02:00
Michael Wright
867ac98d38
Fix double_parens false positive
...
Closes #3206
2018-09-22 17:20:34 +02:00
Jay Kickliter
2f53aaa5bd
mem_replace: match on path.
2018-09-19 14:41:22 -07:00
Jay Kickliter
598df08d88
Add lint for mem::replace(.., None)
.
...
Suggest `Option::take()` as an alternative.
2018-09-19 14:38:34 -07:00
Eduard-Mihai Burtescu
407ff8d6be
Reintroduce extern crate
for non-Cargo dependencies, in tests.
2018-09-15 13:37:21 +03:00
Eduard-Mihai Burtescu
85caaf5905
Fix useless_attribute
to also whitelist unused_extern_crates
.
2018-09-15 11:16:45 +03:00
Oliver Schneider
3e4f7fc4c0
Don't use the old feature gate
2018-09-10 15:44:41 +02:00
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer
1c1030f83f
Merge pull request #3152 from PSeitz/master
...
fixes #3151 by skipping the lint instead of crashing
2018-09-10 13:44:47 +02:00
Philipp Krones
f30cf51a70
Merge pull request #3135 from JoshMcguigan/explicit_counter_loop-1219
...
Closes #1219 false positive for explicit_counter_loop
2018-09-09 23:49:03 +02:00
Pascal Seitz
43549ebbf8
fixes #3151 by skipping the lint instead of crashing
2018-09-08 15:30:50 +02:00
Matthias Krüger
160959d27f
add tests for #3057 and #2651
...
Fixes #3057
Fixes #2651
2018-09-08 09:04:04 +02:00
Josh Mcguigan
9168746c38
Corrected explicit_counter_loop behavior with nested loops
2018-09-07 20:46:36 -07:00
Josh Mcguigan
53c262048c
Fix #1219 false positive for explicit_counter_loop
2018-09-07 19:58:19 -07:00
flip1995
90f7997771
Add regression test
2018-09-07 17:41:03 +02:00
Josh Mcguigan
ce554267b8
Updated explicit_counter_loop tests based on discussion in #3135
2018-09-07 05:32:56 -07:00
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer
63a46b1e1a
Merge pull request #3129 from mipli/3091-numeric-typo
...
Add lint for misstyped literal casting
2018-09-07 09:54:43 +02:00
Josh Mcguigan
edfa9feac2
Corrected explicit_counter_loop missing lints if variable used after loop
2018-09-06 06:20:25 -07:00
Matthias Krüger
a0f56edfc3
print_with_newline / write_with_newline: don't warn about string with several \n
s in them.
...
Fixes #3126
2018-09-06 12:59:34 +02:00
Josh Mcguigan
4b668159d2
Closes #1219 false positive for explicit_counter_loop
2018-09-05 19:14:01 -07:00
Michael A. Plikk
38d287fecd
Add lint for misstyped literal casting
2018-09-05 19:46:49 +02:00
Josh Mcguigan
0f6d422817
Added test case for ptr_arg
2018-09-05 05:59:07 -07:00
daubaris
db391c4613
Merge branch 'master' of https://github.com/rust-lang-nursery/rust-clippy into range-plus-one
2018-09-04 18:52:18 +03:00
Josh Holmer
48e6be42d7
Rustup
2018-09-03 23:50:24 -04:00
Josh Holmer
061b2f3057
Apply applicability
2018-09-03 23:29:44 -04:00
Josh Holmer
dfed9751bd
Majority of PR changes
2018-09-03 23:29:44 -04:00
Josh Holmer
fbc93c0166
Lint against needless uses of collect()
...
Handles cases of `.collect().len()`, `.collect().is_empty()`, and
`.collect().contains()`. This lint is intended to be generic enough to
be added to at a later time with other similar patterns that could be
optimized.
Closes #3034
2018-09-03 23:29:44 -04:00
daubaris
1f3676f7d0
Merge branch 'master' of https://github.com/rust-lang-nursery/rust-clippy into range-plus-one
2018-09-03 18:24:47 +03:00
daubaris
b825578a4a
backticks and testcase
2018-09-03 18:24:38 +03:00
Philipp Hansch
c0513097ab
Merge pull request #3092 from illicitonion/issue-2879
...
default_trait_access skips <F as Default>::default()
2018-09-03 17:24:33 +02:00
daubaris
1615a8a2b6
Merge branch 'master' of https://github.com/rust-lang-nursery/rust-clippy into range-plus-one
2018-09-03 17:21:13 +03:00
Josh Triplett
779988303a
iter conservation efforts: save the endangered .iter() and .into_iter()
...
Make explicit_iter_loop and explicit_into_iter_loop allow-by-default, so
that people can turn them on if they want to enforce that style; avoid
presenting them as *the* idiomatic Rust style, rather than just *a* style.
2018-09-03 01:24:46 -07:00
Daniel Wagner-Hall
9f0216d520
Merge branch 'master' into issue-2879
2018-09-03 00:01:57 +01:00
daubaris
846c3dba2c
resolved conflicts
2018-09-01 09:37:42 +03:00
Manish Goregaokar
c81d70e6bd
Merge pull request #2977 from flip1995/tool_lints
...
Implement tool_lints
2018-09-01 11:22:23 +05:30
Manish Goregaokar
9abf6fca9c
Fix ptr offset tests
2018-08-31 00:38:27 -07:00
Oliver Schneider
73e8416df3
Merge pull request #3081 from mikerite/fix-3078
...
Fix #3078
2018-08-31 09:05:39 +02:00
daubaris
679bc32f46
range_plus_one suggestion should not remove braces fix
2018-08-30 20:06:13 +03:00
Manish Goregaokar
e0ad732226
Merge pull request #3105 from frewsxcv/frewsxcv-private
...
Make clippy_lints::{utils,consts} modules private, remove unused items.
2018-08-29 11:24:00 -07:00
flip1995
cfd4c538d4
Adapt ui-toml-tests to the tool_lints
2018-08-29 11:08:29 -07:00
flip1995
ea43fedf9e
Adapt run-pass tests to the tool_lints
2018-08-29 11:08:29 -07:00
flip1995
e9af09c274
Adapt the *.stderr files of the ui-tests to the tool_lints
2018-08-29 11:08:29 -07:00
flip1995
1b6f6051a8
Adapt ui-tests to the tool_lints
2018-08-29 11:08:29 -07:00
Corey Farwell
2fa7351c1e
suggest wrapping_offset as well
2018-08-29 07:40:00 -05:00
Corey Farwell
5ebae01c1e
New lint: Suggest ptr.add([usize])
over ptr.offset([usize] as isize)
.
...
First part of #3047 .
2018-08-28 23:21:29 -05:00
Corey Farwell
05f637cf88
Make clippy_lints::{utils,consts} modules private, remove unused items.
2018-08-28 21:32:20 -05:00
Daniel Wagner-Hall
350036a0c7
default_trait_access skips <F as Default>::default()
...
This includes the type name, so is clear, and may be necessary.
There doesn't seem to be an obviously cleaner way to pull out the
literal text of the named type here.
Fixes #2879
2018-08-27 23:22:07 +01:00
Michael Wright
45ceecc79c
Fix #3078
2018-08-25 14:49:56 +02:00
Philipp Krones
e91147832c
Merge pull request #3048 from goodmanjonathan/assign_op
...
deprecate assign_ops lint
2018-08-24 18:29:31 +02:00