Skip to content

Commit

Permalink
chore: code smell
Browse files Browse the repository at this point in the history
Signed-off-by: iGxnon <igxnon@gmail.com>
  • Loading branch information
iGxnon committed Jan 9, 2024
1 parent b6b9f73 commit a4fe329
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions curp/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ trait LeaderStateUpdate {
}

/// Client builder to build a client
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Default)]
#[allow(clippy::module_name_repetitions)] // better than just Builder
pub struct ClientBuilder {
/// initial cluster version
Expand Down Expand Up @@ -175,10 +175,8 @@ impl ClientBuilder {
#[must_use]
pub fn new(config: ClientConfig) -> Self {
Self {
cluster_version: None,
all_members: None,
leader_state: None,
config,
..ClientBuilder::default()
}
}

Expand Down
3 changes: 1 addition & 2 deletions xline/src/storage/compact/periodic_compactor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ impl<C: Compactable> PeriodicCompactor<C> {
}

/// perform auto compaction logic
#[allow(clippy::pattern_type_mismatch)] // allow let Some matching
async fn do_compact(
&self,
last_revision: Option<i64>,
Expand All @@ -108,7 +107,7 @@ impl<C: Compactable> PeriodicCompactor<C> {
revision, self.period
);

let Some(compactable) = &*self.compactable.read().await else {
let Some(ref compactable) = *self.compactable.read().await else {
return None;

Check warning on line 111 in xline/src/storage/compact/periodic_compactor.rs

View check run for this annotation

Codecov / codecov/patch

xline/src/storage/compact/periodic_compactor.rs#L111

Added line #L111 was not covered by tests
};

Expand Down
3 changes: 1 addition & 2 deletions xline/src/storage/compact/revision_compactor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ impl<C: Compactable> RevisionCompactor<C> {
}

/// perform auto compaction logic
#[allow(clippy::pattern_type_mismatch)] // allow let Some matching
async fn do_compact(&self, last_revision: Option<i64>) -> Option<i64> {
if !self.is_leader.load(Relaxed) {
return None;
Expand All @@ -67,7 +66,7 @@ impl<C: Compactable> RevisionCompactor<C> {
target_revision, self.retention
);

let Some(compactable) = &*self.compactable.read().await else {
let Some(ref compactable) = *self.compactable.read().await else {
return None;

Check warning on line 70 in xline/src/storage/compact/revision_compactor.rs

View check run for this annotation

Codecov / codecov/patch

xline/src/storage/compact/revision_compactor.rs#L70

Added line #L70 was not covered by tests
};

Expand Down

0 comments on commit a4fe329

Please sign in to comment.