chore: lint `lifecycle` crate
parent
f79349bce0
commit
7f188c3c94
|
@ -82,7 +82,10 @@
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
|
|
||||||
use std::ops::{Deref, DerefMut};
|
use std::{
|
||||||
|
fmt::Debug,
|
||||||
|
ops::{Deref, DerefMut},
|
||||||
|
};
|
||||||
|
|
||||||
use tracker::{RwLock, RwLockUpgradableReadGuard, RwLockWriteGuard};
|
use tracker::{RwLock, RwLockUpgradableReadGuard, RwLockWriteGuard};
|
||||||
|
|
||||||
|
@ -126,6 +129,12 @@ impl<'a, P, D> LifecycleReadGuard<'a, P, D> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, P, D> Debug for LifecycleReadGuard<'a, P, D> {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
write!(f, "LifecycleReadGuard{{..}}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a, P, D> Deref for LifecycleReadGuard<'a, P, D> {
|
impl<'a, P, D> Deref for LifecycleReadGuard<'a, P, D> {
|
||||||
type Target = P;
|
type Target = P;
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -164,6 +173,12 @@ impl<'a, P, D> LifecycleWriteGuard<'a, P, D> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, P, D> Debug for LifecycleWriteGuard<'a, P, D> {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
write!(f, "LifecycleWriteGuard{{..}}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a, P, D> Deref for LifecycleWriteGuard<'a, P, D> {
|
impl<'a, P, D> Deref for LifecycleWriteGuard<'a, P, D> {
|
||||||
type Target = P;
|
type Target = P;
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
#![deny(broken_intra_doc_links, rust_2018_idioms)]
|
||||||
|
#![warn(
|
||||||
|
missing_copy_implementations,
|
||||||
|
missing_debug_implementations,
|
||||||
|
clippy::explicit_iter_loop,
|
||||||
|
clippy::future_not_send,
|
||||||
|
clippy::use_self,
|
||||||
|
clippy::clone_on_ref_ptr
|
||||||
|
)]
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
|
|
||||||
use data_types::chunk_metadata::ChunkStorage;
|
use data_types::chunk_metadata::ChunkStorage;
|
||||||
|
@ -92,7 +101,7 @@ pub trait LockableChunk: Sized {
|
||||||
/// Note that this can only be called for persisted chunks
|
/// Note that this can only be called for persisted chunks
|
||||||
/// (otherwise the read buffer may contain the *only* copy of this
|
/// (otherwise the read buffer may contain the *only* copy of this
|
||||||
/// chunk's data). In order to drop un-persisted chunks,
|
/// chunk's data). In order to drop un-persisted chunks,
|
||||||
/// [`drop_chunk`](Self::drop_chunk) must be used.
|
/// [`drop_chunk`](LifecycleDb::drop_chunk) must be used.
|
||||||
fn unload_read_buffer(s: LifecycleWriteGuard<'_, Self::Chunk, Self>)
|
fn unload_read_buffer(s: LifecycleWriteGuard<'_, Self::Chunk, Self>)
|
||||||
-> Result<(), Self::Error>;
|
-> Result<(), Self::Error>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
|
use std::fmt::Debug;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
|
@ -222,6 +223,15 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, M> Debug for LifecyclePolicy<'a, M>
|
||||||
|
where
|
||||||
|
&'a M: LifecycleDb,
|
||||||
|
{
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
write!(f, "LifecyclePolicy{{..}}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Completes when the provided tracker completes or never if None provided
|
/// Completes when the provided tracker completes or never if None provided
|
||||||
async fn wait_optional_tracker<Job: Send + Sync + 'static>(tracker: Option<TaskTracker<Job>>) {
|
async fn wait_optional_tracker<Job: Send + Sync + 'static>(tracker: Option<TaskTracker<Job>>) {
|
||||||
match tracker {
|
match tracker {
|
||||||
|
|
Loading…
Reference in New Issue