Add testing implementation for Drop for FileLockEntry
This commit is contained in:
parent
d375a6d2c6
commit
7b11e7dabb
1 changed files with 10 additions and 0 deletions
|
@ -879,6 +879,7 @@ impl<'a> DerefMut for FileLockEntry<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(test))]
|
||||||
impl<'a> Drop for FileLockEntry<'a> {
|
impl<'a> Drop for FileLockEntry<'a> {
|
||||||
/// This will silently ignore errors, use `Store::update` if you want to catch the errors
|
/// This will silently ignore errors, use `Store::update` if you want to catch the errors
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
|
@ -886,6 +887,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
|
/// `EntryContent` type
|
||||||
pub type EntryContent = String;
|
pub type EntryContent = String;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue