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
Here's a minimal example code, the question is about function shutdown.
If direct call handler.stop(), it will errors
error[E0507]: cannot move out of `*watcher` which is behind a mutable reference
|
200 | watcher.stop();
| ^^^^^^^ ------ `*watcher` moved due to this method call
| |
| move occurs because `*watcher` has type `Debouncer<notify::ReadDirectoryChangesWatcher,FileIdMap>`, whic, which does not implement the `Copy` trait
If the method stop(self) can be stop(&mut self), it will be ok.
So what's the proper way to stop the debouncer watcher if it's mut reference?
Here's a minimal example code, the question is about function
shutdown
.If direct call
handler.stop()
, it will errorsIf the method
stop(self)
can bestop(&mut self)
, it will be ok.So what's the proper way to stop the debouncer watcher if it's mut reference?
The text was updated successfully, but these errors were encountered: