[CHERRY-PICK] Add testing implementation for Drop for FileLockEntry

This commit is contained in:
Matthias Beyer 2016-10-07 18:46:50 +02:00
parent 485d280236
commit cf50ddae33

View file

@ -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;