-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workingcopy: fix lock to be more Rusty
Summary: The Rust repo locks were a direct translation of Python: ``` let _wlock = wc.lock()?; // ... do stuff with lock ``` That led to the common mistake: ``` // Oops - didn't check error. let _wlock = wc.lock(); ``` Let's change to a more Rusty flow where locking yields an object explicitly. In our case, (WorkingCopy).lock() now yields a LockedWorkingCopy, which has some must-be-locked methods moved to it. Reviewed By: quark-zju Differential Revision: D52055451 fbshipit-source-id: a41f58bcdd34ded6feeb42623e593079c0b683c0
- Loading branch information
1 parent
823e0db
commit 530809d
Showing
6 changed files
with
53 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters