File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -283,7 +283,7 @@ impl PathsMut for FsEventPathsMut<'_> {
283283 self . 0 . remove_path ( path)
284284 }
285285
286- fn commit ( & mut self ) -> Result < ( ) > {
286+ fn commit ( self : Box < Self > ) -> Result < ( ) > {
287287 // ignore return error: may be empty path list
288288 let _ = self . 0 . run ( ) ;
289289 Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -303,8 +303,11 @@ pub trait PathsMut {
303303 /// Remove a path from watching. See [`Watcher::unwatch`] for more.
304304 fn remove ( & mut self , path : & Path ) -> Result < ( ) > ;
305305
306- /// Ensure previously added/removed paths are applied.
307- fn commit ( & mut self ) -> Result < ( ) > ;
306+ /// Ensure added/removed paths are applied.
307+ ///
308+ /// The behaviour of dropping a [`PathsMut`] without calling [`commit`] is unspecified.
309+ /// The implementation is free to ignore the changes or not, and may leave the watcher in a started or stopped state.
310+ fn commit ( self : Box < Self > ) -> Result < ( ) > ;
308311}
309312
310313/// Type that can deliver file activity notifications
@@ -371,7 +374,7 @@ pub trait Watcher {
371374 fn remove ( & mut self , path : & Path ) -> Result < ( ) > {
372375 self . 0 . unwatch ( path)
373376 }
374- fn commit ( & mut self ) -> Result < ( ) > {
377+ fn commit ( self : Box < Self > ) -> Result < ( ) > {
375378 Ok ( ( ) )
376379 }
377380 }
You can’t perform that action at this time.
0 commit comments