diff --git a/openraft/src/error.rs b/openraft/src/error.rs index d61c155fa..892dde14b 100644 --- a/openraft/src/error.rs +++ b/openraft/src/error.rs @@ -9,7 +9,6 @@ use serde::Serialize; use crate::raft_types::SnapshotSegmentId; use crate::LogId; -use crate::Membership; use crate::NodeId; use crate::StorageError; @@ -117,12 +116,6 @@ pub enum ChangeMembershipError { matched: Option, 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 }, } #[derive(Debug, thiserror::Error)] diff --git a/openraft/src/lib.rs b/openraft/src/lib.rs index e246293eb..ba9eb532b 100644 --- a/openraft/src/lib.rs +++ b/openraft/src/lib.rs @@ -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; @@ -17,6 +16,7 @@ pub mod error; pub mod metrics; pub mod network; pub mod raft; +pub mod storage; pub mod testing; #[cfg(test)] @@ -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; diff --git a/openraft/src/replication/mod.rs b/openraft/src/replication/mod.rs index dd667e927..2a75e4954 100644 --- a/openraft/src/replication/mod.rs +++ b/openraft/src/replication/mod.rs @@ -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; @@ -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 { diff --git a/openraft/tests/membership/t20_change_membership.rs b/openraft/tests/membership/t20_change_membership.rs index 7a07ee821..7a36a9164 100644 --- a/openraft/tests/membership/t20_change_membership.rs +++ b/openraft/tests/membership/t20_change_membership.rs @@ -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; diff --git a/rust-toolchain b/rust-toolchain index 182ac38d2..a8a615915 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2022-01-03 +nightly-2022-01-01 diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 000000000..c1b210927 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "nightly-2022-01-01" +components = ["rustfmt", "clippy"]