Skip to content

Commit 09a4b8a

Browse files
committed
Update dependencies and fix clippy warnings
1 parent e812c01 commit 09a4b8a

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repository = "https://github.com/notify-rs/notify.git"
1919
edition = "2021"
2020

2121
[workspace.dependencies]
22-
bitflags = "2.6.0"
22+
bitflags = "2.7.0"
2323
crossbeam-channel = "0.5.0"
2424
deser-hjson = "2.2.4"
2525
env_logger = "0.11.2"
@@ -41,7 +41,7 @@ notify-debouncer-mini = { version = "0.5.0", path = "notify-debouncer-mini" }
4141
notify-types = { version = "1.0.0", path = "notify-types" }
4242
pretty_assertions = "1.3.0"
4343
rand = "0.8.5"
44-
rstest = "0.23.0"
44+
rstest = "0.24.0"
4545
serde = { version = "1.0.89", features = ["derive"] }
4646
serde_json = "1.0.39"
4747
tempfile = "3.10.0"

examples/debouncer_mini.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ fn main() {
1212
// emit some events by changing a file
1313
std::thread::spawn(|| {
1414
let path = Path::new("test.txt");
15-
let _ = std::fs::remove_file(&path);
15+
let _ = std::fs::remove_file(path);
1616
// log::info!("running 250ms events");
1717
for _ in 0..20 {
1818
log::trace!("writing..");
19-
std::fs::write(&path, b"Lorem ipsum").unwrap();
19+
std::fs::write(path, b"Lorem ipsum").unwrap();
2020
std::thread::sleep(Duration::from_millis(250));
2121
}
2222
// log::debug!("waiting 20s");
2323
std::thread::sleep(Duration::from_millis(20000));
2424
// log::info!("running 3s events");
2525
for _ in 0..20 {
2626
// log::debug!("writing..");
27-
std::fs::write(&path, b"Lorem ipsum").unwrap();
27+
std::fs::write(path, b"Lorem ipsum").unwrap();
2828
std::thread::sleep(Duration::from_millis(3000));
2929
}
3030
});

examples/debouncer_mini_custom.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ fn main() {
88
// emit some events by changing a file
99
std::thread::spawn(|| {
1010
let path = Path::new("test.txt");
11-
let _ = std::fs::remove_file(&path);
11+
let _ = std::fs::remove_file(path);
1212
loop {
13-
std::fs::write(&path, b"Lorem ipsum").unwrap();
13+
std::fs::write(path, b"Lorem ipsum").unwrap();
1414
std::thread::sleep(Duration::from_millis(250));
1515
}
1616
});

notify-debouncer-full/src/time.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#[cfg(not(test))]
2+
pub use build::*;
3+
14
#[cfg(not(test))]
25
mod build {
36
use std::time::Instant;
@@ -7,8 +10,8 @@ mod build {
710
}
811
}
912

10-
#[cfg(not(test))]
11-
pub use build::*;
13+
#[cfg(test)]
14+
pub use test::*;
1215

1316
#[cfg(test)]
1417
mod test {
@@ -18,12 +21,12 @@ mod test {
1821
};
1922

2023
thread_local! {
21-
static NOW: Mutex<Option<Instant>> = Mutex::new(None);
24+
static NOW: Mutex<Option<Instant>> = const { Mutex::new(None) };
2225
}
2326

2427
pub fn now() -> Instant {
2528
let time = NOW.with(|now| *now.lock().unwrap());
26-
time.unwrap_or_else(|| Instant::now())
29+
time.unwrap_or_else(Instant::now)
2730
}
2831

2932
pub struct MockTime;
@@ -42,6 +45,3 @@ mod test {
4245
}
4346
}
4447
}
45-
46-
#[cfg(test)]
47-
pub use test::*;

0 commit comments

Comments
 (0)