Clippy fixes

without.crypto
Nan Jiang 5 years ago
parent b4f5f53e9d
commit 798b13e74d
  1. 6
      src/env.rs
  2. 2
      src/store/integer.rs

@ -194,12 +194,12 @@ impl Rkv {
/// Otherwise if the environment has the `NO_SYNC` flag set the flushes will be omitted,
/// and with `MAP_ASYNC` they will be asynchronous.
pub fn sync(&self, force: bool) -> Result<(), StoreError> {
self.env.sync(force).map_err(|e| e.into())
self.env.sync(force).map_err(Into::into)
}
/// Retrieves statistics about this environment.
pub fn stat(&self) -> Result<Stat, StoreError> {
self.env.stat().map_err(|e| e.into())
self.env.stat().map_err(Into::into)
}
}
@ -592,7 +592,7 @@ mod tests {
// Open the same store for read while the reader is in progress will panic
let store: Result<SingleStore, StoreError> = k.open_single("sk", StoreOptions::default());
match store {
Err(StoreError::OpenAttemptedDuringTransaction(_thread_id)) => assert!(true),
Err(StoreError::OpenAttemptedDuringTransaction(_thread_id)) => (),
_ => panic!("should panic"),
}
}

@ -44,7 +44,7 @@ where
{
fn to_bytes(&self) -> Result<Vec<u8>, DataError> {
serialize(self) // TODO: limited key length.
.map_err(|e| e.into())
.map_err(Into::into)
}
}

Loading…
Cancel
Save