Skip to content

Commit

Permalink
Fix Applicability
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkuu committed Sep 19, 2019
1 parent a435739 commit 107c161
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/redundant_clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
let mut app = Applicability::MaybeIncorrect;
let mut call_snip = &snip[dot + 1..];
if call_snip.ends_with("()") {
call_snip = &call_snip[..call_snip.len()-2];
if call_snip.as_bytes().iter().all(u8::is_ascii_alphabetic) {
call_snip = call_snip[..call_snip.len()-2].trim();
if call_snip.as_bytes().iter().all(|b| b.is_ascii_alphabetic() || *b == b'_') {
app = Applicability::MachineApplicable;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/redundant_clone.fixed
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-rustfix

// rustfix-only-machine-applicable
use std::ffi::OsString;
use std::path::Path;

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/redundant_clone.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-rustfix

// rustfix-only-machine-applicable
use std::ffi::OsString;
use std::path::Path;

Expand Down

0 comments on commit 107c161

Please sign in to comment.