Skip to content

Commit

Permalink
Change: remove unused error MembershipError::Incompatible
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer committed Jan 17, 2022
1 parent 80ec1f6 commit 7424c96
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 15 deletions.
7 changes: 0 additions & 7 deletions openraft/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use serde::Serialize;

use crate::raft_types::SnapshotSegmentId;
use crate::LogId;
use crate::Membership;
use crate::NodeId;
use crate::StorageError;

Expand Down Expand Up @@ -117,12 +116,6 @@ pub enum ChangeMembershipError {
matched: Option<LogId>,
distance: u64,
},

// TODO(xp): test it in unittest
// TODO(xp): rename this error to some elaborated name.
// TODO(xp): 111 test it
#[error("now allowed to change from {curr:?} to {to:?}")]
Incompatible { curr: Membership, to: BTreeSet<NodeId> },
}

#[derive(Debug, thiserror::Error)]
Expand Down
6 changes: 1 addition & 5 deletions openraft/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ mod defensive;
mod membership;
mod raft_types;
mod replication;
pub mod storage;
mod storage_error;
mod store_ext;
mod store_wrapper;
Expand All @@ -17,6 +16,7 @@ pub mod error;
pub mod metrics;
pub mod network;
pub mod raft;
pub mod storage;
pub mod testing;

#[cfg(test)]
Expand All @@ -32,10 +32,6 @@ pub use crate::config::SnapshotPolicy;
pub use crate::core::EffectiveMembership;
pub use crate::core::State;
pub use crate::defensive::DefensiveCheck;
pub use crate::error::ChangeMembershipError;
pub use crate::error::ClientWriteError;
pub use crate::error::InitializeError;
pub use crate::error::ReplicationError;
pub use crate::membership::Membership;
pub use crate::metrics::RaftMetrics;
pub use crate::network::RaftNetwork;
Expand Down
2 changes: 1 addition & 1 deletion openraft/src/replication/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use tracing::Span;
use crate::config::Config;
use crate::config::SnapshotPolicy;
use crate::error::LackEntry;
use crate::error::ReplicationError;
use crate::raft::AppendEntriesRequest;
use crate::raft::InstallSnapshotRequest;
use crate::raft_types::LogIdOptionExt;
Expand All @@ -34,7 +35,6 @@ use crate::MessageSummary;
use crate::NodeId;
use crate::RaftNetwork;
use crate::RaftStorage;
use crate::ReplicationError;

#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct ReplicationMetrics {
Expand Down
2 changes: 1 addition & 1 deletion openraft/tests/membership/t20_change_membership.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::sync::Arc;
use std::time::Duration;

use maplit::btreeset;
use openraft::ChangeMembershipError;
use openraft::error::ChangeMembershipError;
use openraft::Config;
use openraft::RaftStorage;

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2022-01-03
nightly-2022-01-01
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "nightly-2022-01-01"
components = ["rustfmt", "clippy"]

0 comments on commit 7424c96

Please sign in to comment.