Skip to content

Commit

Permalink
Merge pull request #37 from frugalos/fix-clippy-warnings
Browse files Browse the repository at this point in the history
Fixes clippy warnings(clippy 0.0.212)
  • Loading branch information
shinnya authored Aug 31, 2020
2 parents e5f9af0 + 0b5a198 commit 65809a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/node_state/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ mod tests {
snapshot: vec![],
});
handle.set_initial_log_suffix(
suffix_head.clone(),
suffix_head,
LogSuffix {
head: LogPosition {
prev_term: term,
Expand Down
12 changes: 2 additions & 10 deletions src/node_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,21 +194,13 @@ pub enum RoleState<IO: Io> {
impl<IO: Io> RoleState<IO> {
/// Returns true if this role state is `Loader`.
pub fn is_loader(&self) -> bool {
if let RoleState::Loader(_) = self {
true
} else {
false
}
matches!(self, RoleState::Loader(_))
}

/// Returns true if this role state is `Candidate`.
#[cfg(test)]
pub fn is_candidate(&self) -> bool {
if let RoleState::Candidate(_) = self {
true
} else {
false
}
matches!(self, RoleState::Candidate(_))
}
}

Expand Down

0 comments on commit 65809a8

Please sign in to comment.