Parcourir la source

Rename a lock to _guard to make sure it is not dropped immediately.

Jing Yang il y a 4 ans
Parent
commit
4c4c7f00df
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/snapshot.rs

+ 1 - 1
src/snapshot.rs

@@ -64,7 +64,7 @@ impl SnapshotDaemon {
         self.trigger();
         // Acquire the lock to make sure the daemon thread either has been
         // waiting on the condition, or has not checked `keep_running` yet.
-        let _ = self.current_snapshot.0.lock();
+        let _guard = self.current_snapshot.0.lock();
         self.current_snapshot.1.notify_all();
     }
 }