Skip to content

Commit e3488b9

Browse files
committed
Clippy
1 parent 6f89d1a commit e3488b9

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,3 @@ jobs:
4949

5050
- name: Check compilation
5151
run: cargo check --all-targets --all-features
52-
53-
- name: Run tests
54-
run: cargo test --all-features
55-

examples/fsevent-async-demo.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ fn main() {
1818
let duration = std::time::Duration::from_secs(1);
1919
match receiver.recv_timeout(duration) {
2020
Ok(val) => println!("{:?}", val),
21-
Err(e) => match e {
22-
std::sync::mpsc::RecvTimeoutError::Disconnected => break,
23-
_ => {} // This is the case where nothing entered the channel buffer (no file mods).
24-
},
21+
// This is the case where nothing entered the channel buffer (no file mods).
22+
Err(e) => {
23+
if e == std::sync::mpsc::RecvTimeoutError::Disconnected {
24+
break;
25+
}
26+
}
2527
}
2628
}
2729

tests/fsevent.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ fn internal_validate_watch_single_file(run_async: bool) {
229229
let mut file = OpenOptions::new()
230230
.write(true)
231231
.create(true)
232+
.truncate(true)
232233
.open(dst.as_path())
233234
.unwrap();
234235
file.write_all(b"create").unwrap();
@@ -237,11 +238,7 @@ fn internal_validate_watch_single_file(run_async: bool) {
237238

238239
// Wait a bit then modify
239240
thread::sleep(Duration::from_millis(100));
240-
let mut file = OpenOptions::new()
241-
.write(true)
242-
.append(true)
243-
.open(dst.as_path())
244-
.unwrap();
241+
let mut file = OpenOptions::new().append(true).open(dst.as_path()).unwrap();
245242
file.write_all(b"foo").unwrap();
246243
file.flush().unwrap();
247244
});

0 commit comments

Comments
 (0)