Skip to content

Commit ae7c879

Browse files
Ixentusjames7132
authored andcommitted
Update to notify 5.0 stable (bevyengine#5865)
# Objective - Update notify dependency to 5.0.0 stable - Fix breaking changes - Closes bevyengine#5861 ## Solution - RecommendedWatcher now takes a Config argument. Giving it the default Config should be the same behavior as before (check every 30 seconds)
1 parent 8b5febe commit ae7c879

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

crates/bevy_asset/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ anyhow = "1.0.4"
3030
thiserror = "1.0"
3131
downcast-rs = "1.2.0"
3232
fastrand = "1.7.0"
33-
notify = { version = "=5.0.0-pre.15", optional = true }
33+
notify = { version = "5.0.0", optional = true }
3434
parking_lot = "0.12.1"
3535

3636
[target.'cfg(target_arch = "wasm32")'.dependencies]

crates/bevy_asset/src/filesystem_watcher.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crossbeam_channel::Receiver;
2-
use notify::{Event, RecommendedWatcher, RecursiveMode, Result, Watcher};
2+
use notify::{Config, Event, RecommendedWatcher, RecursiveMode, Result, Watcher};
33
use std::path::Path;
44

55
/// Watches for changes to files on the local filesystem.
@@ -14,9 +14,12 @@ pub struct FilesystemWatcher {
1414
impl Default for FilesystemWatcher {
1515
fn default() -> Self {
1616
let (sender, receiver) = crossbeam_channel::unbounded();
17-
let watcher: RecommendedWatcher = RecommendedWatcher::new(move |res| {
18-
sender.send(res).expect("Watch event send failure.");
19-
})
17+
let watcher: RecommendedWatcher = RecommendedWatcher::new(
18+
move |res| {
19+
sender.send(res).expect("Watch event send failure.");
20+
},
21+
Config::default(),
22+
)
2023
.expect("Failed to create filesystem watcher.");
2124
FilesystemWatcher { watcher, receiver }
2225
}

0 commit comments

Comments
 (0)