From a977378fdd1d4aecbf28ad46b6c5ae8a568aa478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=82=8E=E6=B3=BC?= Date: Wed, 3 Jul 2024 13:56:36 +0800 Subject: [PATCH] Chore: disable inline attribute --- cluster_benchmark/tests/benchmark/network.rs | 3 ++- examples/raft-kv-memstore/src/lib.rs | 3 ++- openraft/src/config/mod.rs | 6 ++++-- openraft/src/core/sm/mod.rs | 3 ++- openraft/src/display_ext.rs | 3 ++- .../engine/handler/following_handler/mod.rs | 18 ++++++++++++------ .../leader_handler/append_entries_test.rs | 9 ++++++--- .../leader_handler/get_read_log_id_test.rs | 9 ++++++--- .../src/engine/handler/leader_handler/mod.rs | 9 ++++++--- .../leader_handler/send_heartbeat_test.rs | 9 ++++++--- openraft/src/engine/handler/log_handler/mod.rs | 6 ++++-- .../engine/handler/replication_handler/mod.rs | 6 ++++-- .../engine/handler/server_state_handler/mod.rs | 3 ++- .../src/engine/handler/snapshot_handler/mod.rs | 6 ++++-- .../src/engine/handler/vote_handler/mod.rs | 6 ++++-- openraft/src/engine/mod.rs | 3 ++- openraft/src/lib.rs | 9 ++++++--- openraft/src/membership/mod.rs | 9 ++++++--- openraft/src/metrics/mod.rs | 3 ++- openraft/src/progress/entry/mod.rs | 3 ++- openraft/src/progress/inflight/mod.rs | 3 ++- openraft/src/progress/mod.rs | 3 ++- openraft/src/quorum/mod.rs | 6 ++++-- openraft/src/raft/mod.rs | 3 ++- .../src/raft_state/membership_state/mod.rs | 6 ++++-- openraft/src/raft_state/mod.rs | 3 ++- openraft/src/timer/mod.rs | 9 ++++++--- openraft/src/vote/leader_id/mod.rs | 15 ++++++++++----- openraft/src/vote/mod.rs | 3 ++- rustfmt.toml | 2 +- stores/memstore/src/lib.rs | 3 ++- stores/rocksstore/src/lib.rs | 3 ++- stores/sledstore/src/lib.rs | 3 ++- tests/tests/fixtures/mod.rs | 9 ++++++--- .../t10_server_metrics_and_data_metrics.rs | 6 ++++-- tests/tests/metrics/t30_leader_metrics.rs | 6 ++++-- 36 files changed, 139 insertions(+), 70 deletions(-) diff --git a/cluster_benchmark/tests/benchmark/network.rs b/cluster_benchmark/tests/benchmark/network.rs index 1f911435f..8b3ec9e9e 100644 --- a/cluster_benchmark/tests/benchmark/network.rs +++ b/cluster_benchmark/tests/benchmark/network.rs @@ -1,6 +1,7 @@ //! A minimized store with least cost for benchmarking Openraft. -#[cfg(feature = "bt")] use std::backtrace::Backtrace; +#[cfg(feature = "bt")] +use std::backtrace::Backtrace; use std::collections::BTreeMap; use std::collections::BTreeSet; use std::sync::Arc; diff --git a/examples/raft-kv-memstore/src/lib.rs b/examples/raft-kv-memstore/src/lib.rs index cab28ecc6..d959c51fc 100644 --- a/examples/raft-kv-memstore/src/lib.rs +++ b/examples/raft-kv-memstore/src/lib.rs @@ -22,7 +22,8 @@ pub mod app; pub mod client; pub mod network; pub mod store; -#[cfg(test)] mod test; +#[cfg(test)] +mod test; pub type NodeId = u64; diff --git a/openraft/src/config/mod.rs b/openraft/src/config/mod.rs index 7885618d9..48a3f072f 100644 --- a/openraft/src/config/mod.rs +++ b/openraft/src/config/mod.rs @@ -1,7 +1,9 @@ -#[allow(clippy::module_inception)] mod config; +#[allow(clippy::module_inception)] +mod config; mod error; -#[cfg(test)] mod config_test; +#[cfg(test)] +mod config_test; pub use config::Config; pub(crate) use config::RuntimeConfig; diff --git a/openraft/src/core/sm/mod.rs b/openraft/src/core/sm/mod.rs index c423f3c03..960f22fcb 100644 --- a/openraft/src/core/sm/mod.rs +++ b/openraft/src/core/sm/mod.rs @@ -11,6 +11,7 @@ pub(crate) mod worker; pub(crate) use command::Command; pub(crate) use command::CommandPayload; -#[allow(unused_imports)] pub(crate) use command::CommandSeq; +#[allow(unused_imports)] +pub(crate) use command::CommandSeq; pub(crate) use response::CommandResult; pub(crate) use response::Response; diff --git a/openraft/src/display_ext.rs b/openraft/src/display_ext.rs index 7463f5d52..0df1a7783 100644 --- a/openraft/src/display_ext.rs +++ b/openraft/src/display_ext.rs @@ -4,7 +4,8 @@ pub(crate) mod display_instant; pub(crate) mod display_option; pub(crate) mod display_slice; -#[allow(unused_imports)] pub(crate) use display_instant::DisplayInstant; +#[allow(unused_imports)] +pub(crate) use display_instant::DisplayInstant; pub(crate) use display_instant::DisplayInstantExt; pub(crate) use display_option::DisplayOption; pub(crate) use display_option::DisplayOptionExt; diff --git a/openraft/src/engine/handler/following_handler/mod.rs b/openraft/src/engine/handler/following_handler/mod.rs index 55a6c955f..99d621fa5 100644 --- a/openraft/src/engine/handler/following_handler/mod.rs +++ b/openraft/src/engine/handler/following_handler/mod.rs @@ -23,12 +23,18 @@ use crate::RaftTypeConfig; use crate::Snapshot; use crate::StoredMembership; -#[cfg(test)] mod append_entries_test; -#[cfg(test)] mod commit_entries_test; -#[cfg(test)] mod do_append_entries_test; -#[cfg(test)] mod install_snapshot_test; -#[cfg(test)] mod truncate_logs_test; -#[cfg(test)] mod update_committed_membership_test; +#[cfg(test)] +mod append_entries_test; +#[cfg(test)] +mod commit_entries_test; +#[cfg(test)] +mod do_append_entries_test; +#[cfg(test)] +mod install_snapshot_test; +#[cfg(test)] +mod truncate_logs_test; +#[cfg(test)] +mod update_committed_membership_test; /// Receive replication request and deal with them. /// diff --git a/openraft/src/engine/handler/leader_handler/append_entries_test.rs b/openraft/src/engine/handler/leader_handler/append_entries_test.rs index c7a83c9bc..bc18615d8 100644 --- a/openraft/src/engine/handler/leader_handler/append_entries_test.rs +++ b/openraft/src/engine/handler/leader_handler/append_entries_test.rs @@ -1,9 +1,12 @@ use std::sync::Arc; use maplit::btreeset; -#[allow(unused_imports)] use pretty_assertions::assert_eq; -#[allow(unused_imports)] use pretty_assertions::assert_ne; -#[allow(unused_imports)] use pretty_assertions::assert_str_eq; +#[allow(unused_imports)] +use pretty_assertions::assert_eq; +#[allow(unused_imports)] +use pretty_assertions::assert_ne; +#[allow(unused_imports)] +use pretty_assertions::assert_str_eq; use crate::engine::testing::UTConfig; use crate::engine::Command; diff --git a/openraft/src/engine/handler/leader_handler/get_read_log_id_test.rs b/openraft/src/engine/handler/leader_handler/get_read_log_id_test.rs index 0a1b576d8..1bda9765b 100644 --- a/openraft/src/engine/handler/leader_handler/get_read_log_id_test.rs +++ b/openraft/src/engine/handler/leader_handler/get_read_log_id_test.rs @@ -1,9 +1,12 @@ use std::sync::Arc; use maplit::btreeset; -#[allow(unused_imports)] use pretty_assertions::assert_eq; -#[allow(unused_imports)] use pretty_assertions::assert_ne; -#[allow(unused_imports)] use pretty_assertions::assert_str_eq; +#[allow(unused_imports)] +use pretty_assertions::assert_eq; +#[allow(unused_imports)] +use pretty_assertions::assert_ne; +#[allow(unused_imports)] +use pretty_assertions::assert_str_eq; use crate::engine::testing::UTConfig; use crate::engine::Engine; diff --git a/openraft/src/engine/handler/leader_handler/mod.rs b/openraft/src/engine/handler/leader_handler/mod.rs index 5ba143f03..bbd785fe7 100644 --- a/openraft/src/engine/handler/leader_handler/mod.rs +++ b/openraft/src/engine/handler/leader_handler/mod.rs @@ -12,9 +12,12 @@ use crate::RaftLogId; use crate::RaftState; use crate::RaftTypeConfig; -#[cfg(test)] mod append_entries_test; -#[cfg(test)] mod get_read_log_id_test; -#[cfg(test)] mod send_heartbeat_test; +#[cfg(test)] +mod append_entries_test; +#[cfg(test)] +mod get_read_log_id_test; +#[cfg(test)] +mod send_heartbeat_test; /// Handle leader operations. /// diff --git a/openraft/src/engine/handler/leader_handler/send_heartbeat_test.rs b/openraft/src/engine/handler/leader_handler/send_heartbeat_test.rs index 262e96dfb..583650610 100644 --- a/openraft/src/engine/handler/leader_handler/send_heartbeat_test.rs +++ b/openraft/src/engine/handler/leader_handler/send_heartbeat_test.rs @@ -1,9 +1,12 @@ use std::sync::Arc; use maplit::btreeset; -#[allow(unused_imports)] use pretty_assertions::assert_eq; -#[allow(unused_imports)] use pretty_assertions::assert_ne; -#[allow(unused_imports)] use pretty_assertions::assert_str_eq; +#[allow(unused_imports)] +use pretty_assertions::assert_eq; +#[allow(unused_imports)] +use pretty_assertions::assert_ne; +#[allow(unused_imports)] +use pretty_assertions::assert_str_eq; use crate::engine::testing::UTConfig; use crate::engine::Command; diff --git a/openraft/src/engine/handler/log_handler/mod.rs b/openraft/src/engine/handler/log_handler/mod.rs index 79f4ff49f..7b36aa24f 100644 --- a/openraft/src/engine/handler/log_handler/mod.rs +++ b/openraft/src/engine/handler/log_handler/mod.rs @@ -8,8 +8,10 @@ use crate::LogIdOptionExt; use crate::RaftState; use crate::RaftTypeConfig; -#[cfg(test)] mod calc_purge_upto_test; -#[cfg(test)] mod purge_log_test; +#[cfg(test)] +mod calc_purge_upto_test; +#[cfg(test)] +mod purge_log_test; /// Handle raft-log related operations pub(crate) struct LogHandler<'x, C> diff --git a/openraft/src/engine/handler/replication_handler/mod.rs b/openraft/src/engine/handler/replication_handler/mod.rs index 9f3a5202e..577c75162 100644 --- a/openraft/src/engine/handler/replication_handler/mod.rs +++ b/openraft/src/engine/handler/replication_handler/mod.rs @@ -23,8 +23,10 @@ use crate::RaftState; use crate::RaftTypeConfig; use crate::ServerState; -#[cfg(test)] mod append_membership_test; -#[cfg(test)] mod update_matching_test; +#[cfg(test)] +mod append_membership_test; +#[cfg(test)] +mod update_matching_test; /// Handle replication operations. /// diff --git a/openraft/src/engine/handler/server_state_handler/mod.rs b/openraft/src/engine/handler/server_state_handler/mod.rs index 148da0e3c..68044d988 100644 --- a/openraft/src/engine/handler/server_state_handler/mod.rs +++ b/openraft/src/engine/handler/server_state_handler/mod.rs @@ -5,7 +5,8 @@ use crate::RaftState; use crate::RaftTypeConfig; use crate::ServerState; -#[cfg(test)] mod update_server_state_test; +#[cfg(test)] +mod update_server_state_test; /// Handle raft server-state related operations pub(crate) struct ServerStateHandler<'st, C> diff --git a/openraft/src/engine/handler/snapshot_handler/mod.rs b/openraft/src/engine/handler/snapshot_handler/mod.rs index 457714e13..053bd03cd 100644 --- a/openraft/src/engine/handler/snapshot_handler/mod.rs +++ b/openraft/src/engine/handler/snapshot_handler/mod.rs @@ -9,8 +9,10 @@ use crate::RaftState; use crate::RaftTypeConfig; use crate::SnapshotMeta; -#[cfg(test)] mod trigger_snapshot_test; -#[cfg(test)] mod update_snapshot_test; +#[cfg(test)] +mod trigger_snapshot_test; +#[cfg(test)] +mod update_snapshot_test; /// Handle raft vote related operations pub(crate) struct SnapshotHandler<'st, 'out, C> diff --git a/openraft/src/engine/handler/vote_handler/mod.rs b/openraft/src/engine/handler/vote_handler/mod.rs index cb7bdb0ea..0c5079389 100644 --- a/openraft/src/engine/handler/vote_handler/mod.rs +++ b/openraft/src/engine/handler/vote_handler/mod.rs @@ -22,8 +22,10 @@ use crate::RaftState; use crate::RaftTypeConfig; use crate::Vote; -#[cfg(test)] mod accept_vote_test; -#[cfg(test)] mod handle_message_vote_test; +#[cfg(test)] +mod accept_vote_test; +#[cfg(test)] +mod handle_message_vote_test; /// Handle raft vote related operations /// diff --git a/openraft/src/engine/mod.rs b/openraft/src/engine/mod.rs index 8e13c481f..abc197056 100644 --- a/openraft/src/engine/mod.rs +++ b/openraft/src/engine/mod.rs @@ -49,7 +49,8 @@ mod tests { mod startup_test; mod trigger_purge_log_test; } -#[cfg(test)] pub(crate) mod testing; +#[cfg(test)] +pub(crate) mod testing; pub(crate) use command::Command; pub(crate) use command::Condition; diff --git a/openraft/src/lib.rs b/openraft/src/lib.rs index e013ba606..50a34e5c6 100644 --- a/openraft/src/lib.rs +++ b/openraft/src/lib.rs @@ -50,7 +50,8 @@ pub(crate) mod type_config; pub(crate) mod utime; pub mod async_runtime; -#[cfg(feature = "compat")] pub mod compat; +#[cfg(feature = "compat")] +pub mod compat; pub mod docs; pub mod entry; pub mod error; @@ -63,7 +64,8 @@ pub mod raft; pub mod storage; pub mod testing; -#[cfg(test)] mod feature_serde_test; +#[cfg(test)] +mod feature_serde_test; pub use anyerror; pub use anyerror::AnyError; @@ -115,7 +117,8 @@ pub use crate::storage_error::ToStorageResult; pub use crate::storage_error::Violation; pub use crate::summary::MessageSummary; pub use crate::try_as_ref::TryAsRef; -#[cfg(feature = "type-alias")] pub use crate::type_config::alias; +#[cfg(feature = "type-alias")] +pub use crate::type_config::alias; pub use crate::type_config::RaftTypeConfig; pub use crate::vote::CommittedLeaderId; pub use crate::vote::LeaderId; diff --git a/openraft/src/membership/mod.rs b/openraft/src/membership/mod.rs index c50c1a939..f577f6d61 100644 --- a/openraft/src/membership/mod.rs +++ b/openraft/src/membership/mod.rs @@ -1,14 +1,17 @@ mod effective_membership; mod into_nodes; -#[allow(clippy::module_inception)] mod membership; +#[allow(clippy::module_inception)] +mod membership; mod stored_membership; #[cfg(feature = "bench")] #[cfg(test)] mod bench; -#[cfg(test)] mod effective_membership_test; -#[cfg(test)] mod membership_test; +#[cfg(test)] +mod effective_membership_test; +#[cfg(test)] +mod membership_test; pub use effective_membership::EffectiveMembership; pub use into_nodes::IntoNodes; diff --git a/openraft/src/metrics/mod.rs b/openraft/src/metrics/mod.rs index 8d672195a..8de408960 100644 --- a/openraft/src/metrics/mod.rs +++ b/openraft/src/metrics/mod.rs @@ -33,7 +33,8 @@ mod wait; mod metric_display; mod wait_condition; -#[cfg(test)] mod wait_test; +#[cfg(test)] +mod wait_test; use std::collections::BTreeMap; diff --git a/openraft/src/progress/entry/mod.rs b/openraft/src/progress/entry/mod.rs index dbf9db2ff..0bff89ae0 100644 --- a/openraft/src/progress/entry/mod.rs +++ b/openraft/src/progress/entry/mod.rs @@ -280,4 +280,5 @@ impl Validate for ProgressEntry { } } -#[cfg(test)] mod tests; +#[cfg(test)] +mod tests; diff --git a/openraft/src/progress/inflight/mod.rs b/openraft/src/progress/inflight/mod.rs index a939a36f4..92df8fd3c 100644 --- a/openraft/src/progress/inflight/mod.rs +++ b/openraft/src/progress/inflight/mod.rs @@ -1,4 +1,5 @@ -#[cfg(test)] mod tests; +#[cfg(test)] +mod tests; use std::error::Error; use std::fmt::Display; diff --git a/openraft/src/progress/mod.rs b/openraft/src/progress/mod.rs index 6140d5197..5f3335148 100644 --- a/openraft/src/progress/mod.rs +++ b/openraft/src/progress/mod.rs @@ -19,7 +19,8 @@ use std::slice::Iter; use std::slice::IterMut; // TODO: remove it -#[allow(unused_imports)] pub(crate) use inflight::Inflight; +#[allow(unused_imports)] +pub(crate) use inflight::Inflight; use crate::quorum::QuorumSet; diff --git a/openraft/src/quorum/mod.rs b/openraft/src/quorum/mod.rs index 78eadbcaa..7eae94383 100644 --- a/openraft/src/quorum/mod.rs +++ b/openraft/src/quorum/mod.rs @@ -14,8 +14,10 @@ mod quorum_set_impl; #[cfg(test)] mod bench; -#[cfg(test)] mod coherent_test; -#[cfg(test)] mod quorum_set_test; +#[cfg(test)] +mod coherent_test; +#[cfg(test)] +mod quorum_set_test; pub(crate) use coherent::Coherent; pub(crate) use coherent::FindCoherent; diff --git a/openraft/src/raft/mod.rs b/openraft/src/raft/mod.rs index bbd02bec7..1ae155260 100644 --- a/openraft/src/raft/mod.rs +++ b/openraft/src/raft/mod.rs @@ -8,7 +8,8 @@ //! This allows multiple components within the application that require interaction with `RaftCore` //! to efficiently share access. -#[cfg(test)] mod declare_raft_types_test; +#[cfg(test)] +mod declare_raft_types_test; mod external_request; mod impl_raft_blocking_write; pub(crate) mod message; diff --git a/openraft/src/raft_state/membership_state/mod.rs b/openraft/src/raft_state/membership_state/mod.rs index 3294b80d8..ba2eeba9e 100644 --- a/openraft/src/raft_state/membership_state/mod.rs +++ b/openraft/src/raft_state/membership_state/mod.rs @@ -10,8 +10,10 @@ use crate::LogIdOptionExt; use crate::RaftTypeConfig; mod change_handler; -#[cfg(test)] mod change_handler_test; -#[cfg(test)] mod membership_state_test; +#[cfg(test)] +mod change_handler_test; +#[cfg(test)] +mod membership_state_test; pub(crate) use change_handler::ChangeHandler; diff --git a/openraft/src/raft_state/mod.rs b/openraft/src/raft_state/mod.rs index 51db4d670..3f68f3dd3 100644 --- a/openraft/src/raft_state/mod.rs +++ b/openraft/src/raft_state/mod.rs @@ -20,7 +20,8 @@ mod log_state_reader; mod membership_state; mod vote_state_reader; -#[allow(unused)] pub(crate) use io_state::log_io_id::LogIOId; +#[allow(unused)] +pub(crate) use io_state::log_io_id::LogIOId; pub(crate) use io_state::IOState; #[cfg(test)] diff --git a/openraft/src/timer/mod.rs b/openraft/src/timer/mod.rs index 00fc763df..86c465a50 100644 --- a/openraft/src/timer/mod.rs +++ b/openraft/src/timer/mod.rs @@ -1,7 +1,10 @@ mod timeout; // Not yet ready to publish :) -#[allow(unused_imports)] pub(crate) use timeout::RaftTimer; -#[allow(unused_imports)] pub(crate) use timeout::Timeout; +#[allow(unused_imports)] +pub(crate) use timeout::RaftTimer; +#[allow(unused_imports)] +pub(crate) use timeout::Timeout; -#[cfg(test)] mod timeout_test; +#[cfg(test)] +mod timeout_test; diff --git a/openraft/src/vote/leader_id/mod.rs b/openraft/src/vote/leader_id/mod.rs index 2b2d585ad..38bc0b056 100644 --- a/openraft/src/vote/leader_id/mod.rs +++ b/openraft/src/vote/leader_id/mod.rs @@ -1,10 +1,15 @@ -#[cfg(not(feature = "single-term-leader"))] mod leader_id_adv; -#[cfg(feature = "single-term-leader")] mod leader_id_std; +#[cfg(not(feature = "single-term-leader"))] +mod leader_id_adv; +#[cfg(feature = "single-term-leader")] +mod leader_id_std; #[cfg(not(feature = "single-term-leader"))] pub use leader_id_adv::CommittedLeaderId; -#[cfg(not(feature = "single-term-leader"))] pub use leader_id_adv::LeaderId; -#[cfg(feature = "single-term-leader")] pub use leader_id_std::CommittedLeaderId; -#[cfg(feature = "single-term-leader")] pub use leader_id_std::LeaderId; +#[cfg(not(feature = "single-term-leader"))] +pub use leader_id_adv::LeaderId; +#[cfg(feature = "single-term-leader")] +pub use leader_id_std::CommittedLeaderId; +#[cfg(feature = "single-term-leader")] +pub use leader_id_std::LeaderId; mod impl_into_leader_id; diff --git a/openraft/src/vote/mod.rs b/openraft/src/vote/mod.rs index d2dd2e058..2146647e4 100644 --- a/openraft/src/vote/mod.rs +++ b/openraft/src/vote/mod.rs @@ -1,5 +1,6 @@ mod leader_id; -#[allow(clippy::module_inception)] mod vote; +#[allow(clippy::module_inception)] +mod vote; pub use leader_id::CommittedLeaderId; pub use leader_id::LeaderId; diff --git a/rustfmt.toml b/rustfmt.toml index d73f34613..377a44e9b 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -33,7 +33,7 @@ overflow_delimited_expr = true wrap_comments = true comment_width = 100 max_width = 120 -inline_attribute_width = 80 +inline_attribute_width = 0 merge_derives = false diff --git a/stores/memstore/src/lib.rs b/stores/memstore/src/lib.rs index 57f1e4b76..e9b6c0a40 100644 --- a/stores/memstore/src/lib.rs +++ b/stores/memstore/src/lib.rs @@ -1,7 +1,8 @@ #![deny(unused_crate_dependencies)] #![deny(unused_qualifications)] -#[cfg(test)] mod test; +#[cfg(test)] +mod test; use std::collections::BTreeMap; use std::collections::HashMap; diff --git a/stores/rocksstore/src/lib.rs b/stores/rocksstore/src/lib.rs index a070c71e1..9c4e31449 100644 --- a/stores/rocksstore/src/lib.rs +++ b/stores/rocksstore/src/lib.rs @@ -5,7 +5,8 @@ #![deny(unused_crate_dependencies)] #![deny(unused_qualifications)] -#[cfg(test)] mod test; +#[cfg(test)] +mod test; use std::collections::BTreeMap; use std::error::Error; diff --git a/stores/sledstore/src/lib.rs b/stores/sledstore/src/lib.rs index 6bce2f250..07d782eea 100644 --- a/stores/sledstore/src/lib.rs +++ b/stores/sledstore/src/lib.rs @@ -1,7 +1,8 @@ #![deny(unused_crate_dependencies)] #![deny(unused_qualifications)] -#[cfg(test)] mod test; +#[cfg(test)] +mod test; use std::collections::BTreeMap; use std::error::Error; diff --git a/tests/tests/fixtures/mod.rs b/tests/tests/fixtures/mod.rs index 53029e8e8..5bcb97152 100644 --- a/tests/tests/fixtures/mod.rs +++ b/tests/tests/fixtures/mod.rs @@ -2,7 +2,8 @@ #![allow(dead_code)] -#[cfg(feature = "bt")] use std::backtrace::Backtrace; +#[cfg(feature = "bt")] +use std::backtrace::Backtrace; use std::collections::BTreeMap; use std::collections::BTreeSet; use std::collections::HashMap; @@ -64,8 +65,10 @@ use openraft_memstore::MemNodeId; use openraft_memstore::MemStateMachine as SMInner; use openraft_memstore::TypeConfig; use openraft_memstore::TypeConfig as MemConfig; -#[allow(unused_imports)] use pretty_assertions::assert_eq; -#[allow(unused_imports)] use pretty_assertions::assert_ne; +#[allow(unused_imports)] +use pretty_assertions::assert_eq; +#[allow(unused_imports)] +use pretty_assertions::assert_ne; use tracing_appender::non_blocking::WorkerGuard; use crate::fixtures::logging::init_file_logging; diff --git a/tests/tests/metrics/t10_server_metrics_and_data_metrics.rs b/tests/tests/metrics/t10_server_metrics_and_data_metrics.rs index 2fba5e91d..7c039304a 100644 --- a/tests/tests/metrics/t10_server_metrics_and_data_metrics.rs +++ b/tests/tests/metrics/t10_server_metrics_and_data_metrics.rs @@ -4,8 +4,10 @@ use std::time::Duration; use anyhow::Result; use maplit::btreeset; use openraft::Config; -#[allow(unused_imports)] use pretty_assertions::assert_eq; -#[allow(unused_imports)] use pretty_assertions::assert_ne; +#[allow(unused_imports)] +use pretty_assertions::assert_eq; +#[allow(unused_imports)] +use pretty_assertions::assert_ne; use crate::fixtures::init_default_ut_tracing; use crate::fixtures::RaftRouter; diff --git a/tests/tests/metrics/t30_leader_metrics.rs b/tests/tests/metrics/t30_leader_metrics.rs index 70bbb55fb..be5861f87 100644 --- a/tests/tests/metrics/t30_leader_metrics.rs +++ b/tests/tests/metrics/t30_leader_metrics.rs @@ -10,8 +10,10 @@ use openraft::CommittedLeaderId; use openraft::Config; use openraft::LogId; use openraft::ServerState; -#[allow(unused_imports)] use pretty_assertions::assert_eq; -#[allow(unused_imports)] use pretty_assertions::assert_ne; +#[allow(unused_imports)] +use pretty_assertions::assert_eq; +#[allow(unused_imports)] +use pretty_assertions::assert_ne; use tokio::time::sleep; use crate::fixtures::init_default_ut_tracing;