@@ -294,49 +294,6 @@ pub enum WatcherKind {
294294 NullWatcher ,
295295}
296296
297- /// Providing methods for adding and removing paths to watch.
298- ///
299- /// `Box<dyn PathsMut>` is created by [`Watcher::paths_mut`]. See its documentation for more.
300- #[ deprecated(
301- since = "9.0.0" ,
302- note = "paths_mut has been replaced with update_paths"
303- ) ]
304- pub trait PathsMut {
305- /// Add a new path to watch. See [`Watcher::watch`] for more.
306- fn add ( & mut self , path : & Path , recursive_mode : RecursiveMode ) -> Result < ( ) > ;
307-
308- /// Remove a path from watching. See [`Watcher::unwatch`] for more.
309- fn remove ( & mut self , path : & Path ) -> Result < ( ) > ;
310-
311- /// Ensure added/removed paths are applied.
312- fn commit ( self : Box < Self > ) -> Result < ( ) > ;
313- }
314-
315- struct PathsMutInternal < ' a , T : ?Sized > {
316- ops : Vec < PathOp > ,
317- watcher : & ' a mut T ,
318- }
319-
320- #[ allow( deprecated) ]
321- impl < ' a , T : Watcher + ?Sized > PathsMut for PathsMutInternal < ' a , T > {
322- fn add ( & mut self , path : & Path , recursive_mode : RecursiveMode ) -> Result < ( ) > {
323- self . ops . push ( PathOp :: Watch (
324- path. to_path_buf ( ) ,
325- WatchPathConfig :: new ( recursive_mode) ,
326- ) ) ;
327- Ok ( ( ) )
328- }
329-
330- fn remove ( & mut self , path : & Path ) -> Result < ( ) > {
331- self . ops . push ( PathOp :: Unwatch ( path. to_path_buf ( ) ) ) ;
332- Ok ( ( ) )
333- }
334-
335- fn commit ( self : Box < Self > ) -> Result < ( ) > {
336- self . watcher . update_paths ( self . ops ) . map_err ( |v| v. source )
337- }
338- }
339-
340297/// Type that can deliver file activity notifications
341298///
342299/// `Watcher` is implemented per platform using the best implementation available on that platform.
@@ -372,19 +329,6 @@ pub trait Watcher {
372329 /// fails.
373330 fn unwatch ( & mut self , path : & Path ) -> Result < ( ) > ;
374331
375- /// deprecated
376- #[ deprecated(
377- since = "9.0.0" ,
378- note = "paths_mut has been replaced with update_paths"
379- ) ]
380- #[ allow( deprecated) ]
381- fn paths_mut < ' me > ( & ' me mut self ) -> Box < dyn PathsMut + ' me > {
382- Box :: new ( PathsMutInternal {
383- watcher : self ,
384- ops : Default :: default ( ) ,
385- } )
386- }
387-
388332 /// Add/remove paths to watch in batch.
389333 ///
390334 /// For some [`Watcher`] implementations this method provides better performance than multiple
0 commit comments