[CHERRY-PICK] Add testing implementation for Drop for FileLockEntry
This commit is contained in:
parent
485d280236
commit
cf50ddae33
1 changed files with 10 additions and 0 deletions
|
@ -924,6 +924,7 @@ impl<'a> DerefMut for FileLockEntry<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<'a> Drop for FileLockEntry<'a> {
|
||||
/// This will silently ignore errors, use `Store::update` if you want to catch the errors
|
||||
fn drop(&mut self) {
|
||||
|
@ -931,6 +932,15 @@ impl<'a> Drop for FileLockEntry<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
impl<'a> Drop for FileLockEntry<'a> {
|
||||
/// This will not silently ignore errors but prints the result of the _update() call for testing
|
||||
fn drop(&mut self) {
|
||||
println!("Drop Result: {:?}", self.store._update(self));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// `EntryContent` type
|
||||
pub type EntryContent = String;
|
||||
|
||||
|
|
Loading…
Reference in a new issue