You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since there can only be one RecommendedWatcher, why do we still need to explicitly specify the type? Taken from the new docs.
use notify::{Watcher,RecommendedWatcher,RecursiveMode,Result};fnmain() -> Result<()>{// Automatically select the best implementation for your platform.letmut watcher:RecommendedWatcher = Watcher::new_immediate(|res| {match res {Ok(event) => println!("event: {:?}", event),Err(e) => println!("watch error: {:?}", e),}})?;// Add a path to be watched. All files and directories at that path and// below will be monitored for changes.
watcher.watch(".",RecursiveMode::Recursive)?;Ok(())}
Not sure if we can remove the explicit type for RecommendedWatcher.
The text was updated successfully, but these errors were encountered:
Ah, I thought let mut watcher = immediate_watcher(...)?; should be more preferably for a demo to attract attention on the api with shortest code. let mut watcher: INotifyWatcher = Watcher::new_immediate(...)?; may be useful later in the first page, explaining how to switch implementation.
Since there can only be one
RecommendedWatcher
, why do we still need to explicitly specify the type? Taken from the new docs.Not sure if we can remove the explicit type for
RecommendedWatcher
.The text was updated successfully, but these errors were encountered: