Skip to content

Commit 80780d8

Browse files
Fix new lint warning in clippy_config
1 parent 22f0c00 commit 80780d8

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

clippy_config/src/conf.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ macro_rules! define_Conf {
173173
}
174174
})*
175175
// ignore contents of the third_party key
176-
Ok(Field::third_party) => drop(map.next_value::<IgnoredAny>())
176+
Ok(Field::third_party) => {
177+
let _ = map.next_value::<IgnoredAny>();
178+
}
177179
}
178180
}
179181
let conf = Conf { $($name: $name.unwrap_or_else(defaults::$name),)* };

clippy_dev/src/update_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ fn try_rename_file(old_name: &Path, new_name: &Path) -> bool {
999999
match fs::rename(old_name, new_name) {
10001000
Ok(()) => true,
10011001
Err(e) => {
1002-
drop(fs::remove_file(new_name));
1002+
let _ = fs::remove_file(new_name);
10031003
if e.kind() == io::ErrorKind::NotFound {
10041004
false
10051005
} else {

tests/ui/drop_result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[warn(clippy::drop_result)]
1+
#![warn(clippy::drop_result)]
22

33
fn make_result<T>(t: T) -> Result<T, ()> {
44
Ok(t)

tests/ui/drop_result.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: using `drop()` on a `Result` type
2-
--> $DIR/drop_result.rs:6:5
2+
--> $DIR/drop_result.rs:8:5
33
|
44
LL | drop(Ok::<String, ()>("a".to_string()));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,13 +8,13 @@ LL | drop(Ok::<String, ()>("a".to_string()));
88
= help: to override `-D warnings` add `#[allow(clippy::drop_result)]`
99

1010
error: using `drop()` on a `Result` type
11-
--> $DIR/drop_result.rs:8:5
11+
--> $DIR/drop_result.rs:10:5
1212
|
1313
LL | drop(x);
1414
| ^^^^^^^
1515

1616
error: using `drop()` on a `Result` type
17-
--> $DIR/drop_result.rs:9:5
17+
--> $DIR/drop_result.rs:11:5
1818
|
1919
LL | drop(make_result("a".to_string()));
2020
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)