From b5f56e831dd9f96585d44c460d49b055363067ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Sun, 11 Apr 2021 05:33:30 +1200 Subject: [PATCH] Formatting --- src/args.rs | 8 ++++++-- src/config.rs | 2 +- src/watcher.rs | 7 +++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/args.rs b/src/args.rs index c4de34b..e975853 100644 --- a/src/args.rs +++ b/src/args.rs @@ -207,11 +207,15 @@ where builder.ignores(ignores); if args.occurrences_of("poll") > 0 { - builder.poll_interval(Duration::from_millis(value_t!(args.value_of("poll"), u64).unwrap_or_else(|e| e.exit()))); + builder.poll_interval(Duration::from_millis( + value_t!(args.value_of("poll"), u64).unwrap_or_else(|e| e.exit()), + )); } if args.occurrences_of("debounce") > 0 { - builder.debounce(Duration::from_millis(value_t!(args.value_of("debounce"), u64).unwrap_or_else(|e| e.exit()))); + builder.debounce(Duration::from_millis( + value_t!(args.value_of("debounce"), u64).unwrap_or_else(|e| e.exit()), + )); } builder.on_busy_update(if args.is_present("restart") { diff --git a/src/config.rs b/src/config.rs index dcbeea6..97304da 100644 --- a/src/config.rs +++ b/src/config.rs @@ -13,7 +13,7 @@ //! .expect("mission failed"); //! ``` -use std::{time::Duration, path::PathBuf}; +use std::{path::PathBuf, time::Duration}; use crate::process::Shell; use crate::run::OnBusyUpdate; diff --git a/src/watcher.rs b/src/watcher.rs index bc4ca03..c31d0d6 100644 --- a/src/watcher.rs +++ b/src/watcher.rs @@ -1,8 +1,8 @@ use notify::{raw_watcher, PollWatcher, RecommendedWatcher, RecursiveMode}; use std::convert::TryFrom; -use std::time::Duration; use std::path::PathBuf; use std::sync::mpsc::Sender; +use std::time::Duration; /// Thin wrapper over the notify crate /// @@ -32,7 +32,10 @@ impl Watcher { use notify::Watcher; let imp = if poll { - let mut watcher = PollWatcher::with_delay_ms(tx, u32::try_from(interval.as_millis()).unwrap_or(u32::MAX))?; + let mut watcher = PollWatcher::with_delay_ms( + tx, + u32::try_from(interval.as_millis()).unwrap_or(u32::MAX), + )?; for path in paths { watcher.watch(path, RecursiveMode::Recursive)?; debug!("Watching {:?}", path);