Skip to content

Commit

Permalink
Chore: fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer committed Aug 31, 2024
1 parent 7d6769a commit fbfa018
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
4 changes: 3 additions & 1 deletion examples/raft-kv-memstore-network-v2/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ pub struct StoredSnapshot {
pub data: Box<typ::SnapshotData>,
}

/// Data contained in the Raft state machine. Note that we are using `serde` to serialize the
/// Data contained in the Raft state machine.
///
/// Note that we are using `serde` to serialize the
/// `data`, which has a implementation to be serialized. Note that for this test we set both the key
/// and value as String, but you could set any type of value that has the serialization impl.
#[derive(Serialize, Deserialize, Debug, Default, Clone)]
Expand Down
4 changes: 3 additions & 1 deletion examples/raft-kv-memstore-opendal-snapshot-data/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ pub struct StoredSnapshot {
pub data: Box<typ::SnapshotData>,
}

/// Data contained in the Raft state machine. Note that we are using `serde` to serialize the
/// Data contained in the Raft state machine.
///
/// Note that we are using `serde` to serialize the
/// `data`, which has a implementation to be serialized. Note that for this test we set both the key
/// and value as String, but you could set any type of value that has the serialization impl.
#[derive(Serialize, Deserialize, Debug, Default, Clone)]
Expand Down
4 changes: 3 additions & 1 deletion examples/raft-kv-memstore-singlethreaded/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ pub struct StoredSnapshot {
pub data: Vec<u8>,
}

/// Data contained in the Raft state machine. Note that we are using `serde` to serialize the
/// Data contained in the Raft state machine.
///
/// Note that we are using `serde` to serialize the
/// `data`, which has a implementation to be serialized. Note that for this test we set both the key
/// and value as String, but you could set any type of value that has the serialization impl.
#[derive(Serialize, Deserialize, Debug, Default, Clone)]
Expand Down
4 changes: 3 additions & 1 deletion examples/raft-kv-memstore/src/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ pub struct StoredSnapshot {
pub data: Vec<u8>,
}

/// Data contained in the Raft state machine. Note that we are using `serde` to serialize the
/// Data contained in the Raft state machine.
///
/// Note that we are using `serde` to serialize the
/// `data`, which has a implementation to be serialized. Note that for this test we set both the key
/// and value as String, but you could set any type of value that has the serialization impl.
#[derive(Serialize, Deserialize, Debug, Default, Clone)]
Expand Down
2 changes: 2 additions & 0 deletions openraft/src/error/streaming_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ impl<C: RaftTypeConfig> From<StreamingError<C, Fatal<C>>> for ReplicationError<C

impl<C: RaftTypeConfig> From<RPCError<C>> for StreamingError<C> {
fn from(value: RPCError<C>) -> Self {
#[allow(unreachable_patterns)]
match value {
RPCError::Timeout(e) => StreamingError::Timeout(e),
RPCError::Unreachable(e) => StreamingError::Unreachable(e),
Expand All @@ -80,6 +81,7 @@ impl<C: RaftTypeConfig> From<RPCError<C>> for StreamingError<C> {

impl<C: RaftTypeConfig> From<StreamingError<C>> for ReplicationError<C> {
fn from(e: StreamingError<C>) -> Self {
#[allow(unreachable_patterns)]
match e {
StreamingError::Closed(e) => ReplicationError::Closed(e),
StreamingError::StorageError(e) => ReplicationError::StorageError(e),
Expand Down
7 changes: 2 additions & 5 deletions openraft/src/raft/raft_inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,8 @@ where C: RaftTypeConfig
message_summary.unwrap_or_default()
);

match core_res {
// A normal quit is still an unexpected "stop" to the caller.
Ok(_) => Fatal::Stopped,
Err(e) => e,
}
// Safe unwrap: core_res is always an error
core_res.unwrap_err()
}

/// Wait for `RaftCore` task to finish and record the returned value from the task.
Expand Down

0 comments on commit fbfa018

Please sign in to comment.