Skip to content

Commit

Permalink
Merge pull request #2173 from 0xpr03/master
Browse files Browse the repository at this point in the history
upgrade to notify 6.1.1 and watcher-mini 4.1
  • Loading branch information
ehuss committed Nov 24, 2023
2 parents ad55f53 + 079f52a commit a016ac0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 117 deletions.
145 changes: 36 additions & 109 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ toml = "0.5.11" # Do not update, see https://github.com/rust-lang/mdBook/issues/
topological-sort = "0.2.2"

# Watch feature
notify = { version = "6.0.1", optional = true }
notify-debouncer-mini = { version = "0.3.0", optional = true }
notify = { version = "6.1.1", optional = true }
notify-debouncer-mini = { version = "0.4.1", optional = true }
ignore = { version = "0.4.20", optional = true }

# Serve feature
Expand Down
9 changes: 3 additions & 6 deletions src/cmd/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ where
// Create a channel to receive the events.
let (tx, rx) = channel();

let mut debouncer = match notify_debouncer_mini::new_debouncer(Duration::from_secs(1), None, tx)
{
let mut debouncer = match notify_debouncer_mini::new_debouncer(Duration::from_secs(1), tx) {
Ok(d) => d,
Err(e) => {
error!("Error while trying to watch the files:\n\n\t{:?}", e);
Expand Down Expand Up @@ -157,10 +156,8 @@ where
let paths: Vec<_> = all_events
.filter_map(|event| match event {
Ok(events) => Some(events),
Err(errors) => {
for error in errors {
log::warn!("error while watching for changes: {error}");
}
Err(error) => {
log::warn!("error while watching for changes: {error}");
None
}
})
Expand Down

0 comments on commit a016ac0

Please sign in to comment.