Skip to content

Commit

Permalink
Chore: fix lint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer committed Mar 5, 2024
1 parent 0c0b73e commit ececf02
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions openraft/src/core/raft_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@ where

/// Reject a request due to the Raft node being in a state which prohibits the request.
#[tracing::instrument(level = "trace", skip(self, tx))]
pub(crate) fn reject_with_forward_to_leader<T: OptionalSend, E: OptionalSend>(&self, tx: ResultSender<C, T, E>)
where E: From<ForwardToLeader<C::NodeId, C::Node>> {
pub(crate) fn reject_with_forward_to_leader<T: OptionalSend, E>(&self, tx: ResultSender<C, T, E>)
where E: From<ForwardToLeader<C::NodeId, C::Node>> + OptionalSend {
let mut leader_id = self.current_leader();
let leader_node = self.get_leader_node(leader_id);

Expand Down
2 changes: 1 addition & 1 deletion openraft/src/entry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ where
impl<C> Debug for Entry<C>
where C: RaftTypeConfig
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Entry").field("log_id", &self.log_id).field("payload", &self.payload).finish()
}
}
Expand Down
4 changes: 2 additions & 2 deletions openraft/src/testing/suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1098,8 +1098,8 @@ where
}
}

fn log_id_0<NID: NodeId>(term: u64, index: u64) -> LogId<NID>
where NID: From<u64> {
fn log_id_0<NID>(term: u64, index: u64) -> LogId<NID>
where NID: NodeId + From<u64> {
LogId {
leader_id: CommittedLeaderId::new(term, NODE_ID.into()),
index,
Expand Down
2 changes: 1 addition & 1 deletion openraft/src/vote/leader_id/leader_id_adv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl<NID: NodeId> LeaderId<NID> {
}
}

impl<NID: NodeId> std::fmt::Display for LeaderId<NID> {
impl<NID: NodeId> fmt::Display for LeaderId<NID> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}-{}", self.term, self.node_id)
}
Expand Down
4 changes: 2 additions & 2 deletions openraft/src/vote/leader_id/leader_id_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl<NID: NodeId> LeaderId<NID> {
}
}

impl<NID: NodeId> std::fmt::Display for LeaderId<NID> {
impl<NID: NodeId> fmt::Display for LeaderId<NID> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}-{:?}", self.term, self.voted_for)
}
Expand All @@ -82,7 +82,7 @@ pub struct CommittedLeaderId<NID> {
p: PhantomData<NID>,
}

impl<NID: NodeId> std::fmt::Display for CommittedLeaderId<NID> {
impl<NID: NodeId> fmt::Display for CommittedLeaderId<NID> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.term)
}
Expand Down

0 comments on commit ececf02

Please sign in to comment.