Add some clippy lints and remove commented inner_load

This commit is contained in:
niluxv
2020-07-03 19:01:39 +02:00
parent 88f4061841
commit c8a15bc79b
2 changed files with 15 additions and 10 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ impl Mmap {
self.inner.flush()
}
/// Increases mmap size by max(old_size*2, new_size).
/// Increases mmap size by `max(old_size*2, new_size)`.
///
/// Note that it doesn't copy original data
fn resize_no_copy(&mut self, new_size: usize) -> io::Result<()> {
+14 -9
View File
@@ -17,6 +17,19 @@
unused_must_use,
unused_mut,
while_true,
clippy::panic,
clippy::print_stdout,
clippy::todo,
clippy::unwrap_used,
clippy::wrong_pub_self_convention,
)]
#![warn(clippy::pedantic)]
// part of `clippy::pedantic`, causing many warnings
#![allow(
clippy::missing_errors_doc,
clippy::module_name_repetitions
)]
//! # Rustbreak
@@ -214,7 +227,7 @@ use crate::backend::MmapStorage;
///
/// - `Data`: Is the Data, you must specify this
/// - `Back`: The storage backend.
/// - `DeSer`: The Serializer/Deserializer or short DeSer. Check the [`deser`] module for other
/// - `DeSer`: The Serializer/Deserializer or short `DeSer`. Check the [`deser`] module for other
/// strategies.
///
/// # Panics
@@ -490,14 +503,6 @@ impl<Data, Back, DeSer> Database<Data, Back, DeSer>
self.data.write().map_err(|_| error::RustbreakErrorKind::Poison.into())
}
// // Now replaced by [`load_get_data_lock`].
// fn inner_load(backend: &mut Back, deser: &DeSer) -> error::Result<Data> {
// let new_data = deser.deserialize(
// &backend.get_data().context(error::RustbreakErrorKind::Backend)?[..]
// ).context(error::RustbreakErrorKind::Deserialization)?;
//
// Ok(new_data)
// }
/// Like [`Self::load`] but returns the write lock to data it used.
fn load_get_data_lock(&self) -> error::Result<RwLockWriteGuard<'_, Data>> {