Repository: slawlor/ractor
Pull request #354 (2025-05-13 21:18:27)

apply opinionated rustfmt
```
format_code_in_doc_comments = true
imports_granularity = "Item"
reorder_imports = true
group_imports = "StdExternalCrate"
```

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/slawlor/ractor/pull/354?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sean+Lawlor) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 80.99%. Comparing base [(`46ac951`)](https://app.codecov.io/gh/slawlor/ractor/commit/46ac951cdd2625730e34f12f8450d467bd6632aa?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sean+Lawlor) to head [(`34deed3`)](https://app.codecov.io/gh/slawlor/ractor/commit/34deed3ced64c3ef0d275beda17fc8c62b03dae9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sean+Lawlor).

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##             main     #354   +/-   ##
=======================================
  Coverage   80.99%   80.99%           
=======================================
  Files          70       70           
  Lines       14415    14415           
=======================================
  Hits        11675    11675           
  Misses       2740     2740           
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/slawlor/ractor/pull/354?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sean+Lawlor).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sean+Lawlor).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>

Patch:
diff --git a/ractor/benches/actor.rs b/ractor/benches/actor.rs
index 9ecbe1f..4c868f5 100644
--- a/ractor/benches/actor.rs
+++ b/ractor/benches/actor.rs
@@ -6,10 +6,13 @@
 #[macro_use]
 extern crate criterion;
 
-use criterion::{BatchSize, Criterion};
+use criterion::BatchSize;
+use criterion::Criterion;
+use ractor::Actor;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
 #[cfg(feature = "cluster")]
 use ractor::Message;
-use ractor::{Actor, ActorProcessingErr, ActorRef};
 
 struct BenchActor;
 
diff --git a/ractor/benches/async_traits.rs b/ractor/benches/async_traits.rs
index 6ccf754..d236bce 100644
--- a/ractor/benches/async_traits.rs
+++ b/ractor/benches/async_traits.rs
@@ -14,10 +14,13 @@
 #[macro_use]
 extern crate criterion;
 
-use criterion::{BatchSize, Criterion};
+use criterion::BatchSize;
+use criterion::Criterion;
+use ractor::Actor;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
 #[cfg(feature = "cluster")]
 use ractor::Message;
-use ractor::{Actor, ActorProcessingErr, ActorRef};
 
 #[allow(clippy::async_yields_async)]
 fn big_stack_futures(c: &mut Criterion) {
diff --git a/ractor/examples/a_whole_lotta.rs b/ractor/examples/a_whole_lotta.rs
index 2f82769..f30cc9b 100644
--- a/ractor/examples/a_whole_lotta.rs
+++ b/ractor/examples/a_whole_lotta.rs
@@ -15,7 +15,9 @@
 
 extern crate ractor;
 
-use ractor::{Actor, ActorProcessingErr, ActorRef};
+use ractor::Actor;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
 
 struct Counter;
 
@@ -41,6 +43,7 @@ fn init_logging() {
 
     use std::io::stderr;
     use std::io::IsTerminal;
+
     use tracing_glog::Glog;
     use tracing_glog::GlogFields;
     use tracing_subscriber::filter::EnvFilter;
diff --git a/ractor/examples/a_whole_lotta_messages.rs b/ractor/examples/a_whole_lotta_messages.rs
index 5671310..1b398ba 100644
--- a/ractor/examples/a_whole_lotta_messages.rs
+++ b/ractor/examples/a_whole_lotta_messages.rs
@@ -15,7 +15,10 @@
 
 extern crate ractor;
 
-use ractor::{concurrency::Duration, Actor, ActorProcessingErr, ActorRef};
+use ractor::concurrency::Duration;
+use ractor::Actor;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
 
 struct Counter;
 
@@ -52,6 +55,7 @@ fn init_logging() {
 
     use std::io::stderr;
     use std::io::IsTerminal;
+
     use tracing_glog::Glog;
     use tracing_glog::GlogFields;
     use tracing_subscriber::filter::EnvFilter;
diff --git a/ractor/examples/counter.rs b/ractor/examples/counter.rs
index 1de42ea..9cd14e3 100644
--- a/ractor/examples/counter.rs
+++ b/ractor/examples/counter.rs
@@ -16,7 +16,11 @@
 
 extern crate ractor;
 
-use ractor::{call_t, Actor, ActorProcessingErr, ActorRef, RpcReplyPort};
+use ractor::call_t;
+use ractor::Actor;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
+use ractor::RpcReplyPort;
 
 struct Counter;
 
@@ -79,6 +83,7 @@ fn init_logging() {
 
     use std::io::stderr;
     use std::io::IsTerminal;
+
     use tracing_glog::Glog;
     use tracing_glog::GlogFields;
     use tracing_subscriber::filter::EnvFilter;
diff --git a/ractor/examples/monte_carlo.rs b/ractor/examples/monte_carlo.rs
index 0477a6c..efde377 100644
--- a/ractor/examples/monte_carlo.rs
+++ b/ractor/examples/monte_carlo.rs
@@ -19,8 +19,13 @@
 
 use std::collections::HashMap;
 
-use ractor::{cast, Actor, ActorId, ActorProcessingErr, ActorRef};
-use rand::{thread_rng, Rng};
+use ractor::cast;
+use ractor::Actor;
+use ractor::ActorId;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
+use rand::thread_rng;
+use rand::Rng;
 
 // ================== Player Actor ================== //
 
@@ -208,6 +213,7 @@ fn init_logging() {
 
     use std::io::stderr;
     use std::io::IsTerminal;
+
     use tracing_glog::Glog;
     use tracing_glog::GlogFields;
     use tracing_subscriber::filter::EnvFilter;
diff --git a/ractor/examples/output_port.rs b/ractor/examples/output_port.rs
index dd41c47..f684511 100644
--- a/ractor/examples/output_port.rs
+++ b/ractor/examples/output_port.rs
@@ -17,8 +17,12 @@ extern crate ractor;
 
 use std::sync::Arc;
 
-use ractor::{Actor, ActorProcessingErr, ActorRef, OutputPort};
-use tokio::time::{timeout, Duration};
+use ractor::Actor;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
+use ractor::OutputPort;
+use tokio::time::timeout;
+use tokio::time::Duration;
 
 enum PublisherMessage {
     Publish(String),
@@ -107,6 +111,7 @@ fn init_logging() {
 
     use std::io::stderr;
     use std::io::IsTerminal;
+
     use tracing_glog::Glog;
     use tracing_glog::GlogFields;
     use tracing_subscriber::filter::EnvFilter;
diff --git a/ractor/examples/philosophers.rs b/ractor/examples/philosophers.rs
index f8cd9a2..08ad9a3 100644
--- a/ractor/examples/philosophers.rs
+++ b/ractor/examples/philosophers.rs
@@ -20,10 +20,18 @@
 
 #![allow(clippy::incompatible_msrv)]
 
-use std::collections::{HashMap, VecDeque};
-
-use ractor::{cast, Actor, ActorId, ActorName, ActorProcessingErr, ActorRef, RpcReplyPort};
-use tokio::time::{Duration, Instant};
+use std::collections::HashMap;
+use std::collections::VecDeque;
+
+use ractor::cast;
+use ractor::Actor;
+use ractor::ActorId;
+use ractor::ActorName;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
+use ractor::RpcReplyPort;
+use tokio::time::Duration;
+use tokio::time::Instant;
 
 // ============================ Fork Actor ============================ //
 
@@ -465,6 +473,7 @@ fn init_logging() {
 
     use std::io::stderr;
     use std::io::IsTerminal;
+
     use tracing_glog::Glog;
     use tracing_glog::GlogFields;
     use tracing_subscriber::filter::EnvFilter;
diff --git a/ractor/examples/ping_pong.rs b/ractor/examples/ping_pong.rs
index d346d6f..bdfd58b 100644
--- a/ractor/examples/ping_pong.rs
+++ b/ractor/examples/ping_pong.rs
@@ -16,7 +16,10 @@
 
 extern crate ractor;
 
-use ractor::{cast, Actor, ActorProcessingErr, ActorRef};
+use ractor::cast;
+use ractor::Actor;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
 
 pub struct PingPong;
 
@@ -85,6 +88,7 @@ fn init_logging() {
 
     use std::io::stderr;
     use std::io::IsTerminal;
+
     use tracing_glog::Glog;
     use tracing_glog::GlogFields;
     use tracing_subscriber::filter::EnvFilter;
diff --git a/ractor/examples/supervisor.rs b/ractor/examples/supervisor.rs
index 1a3f0fe..3696728 100644
--- a/ractor/examples/supervisor.rs
+++ b/ractor/examples/supervisor.rs
@@ -13,8 +13,11 @@
 
 #![allow(clippy::incompatible_msrv)]
 
-use ractor::{Actor, ActorProcessingErr, ActorRef, RpcReplyPort, SupervisionEvent};
-
+use ractor::Actor;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
+use ractor::RpcReplyPort;
+use ractor::SupervisionEvent;
 use tokio::time::Duration;
 
 // ============================== Main ============================== //
@@ -24,6 +27,7 @@ fn init_logging() {
 
     use std::io::stderr;
     use std::io::IsTerminal;
+
     use tracing_glog::Glog;
     use tracing_glog::GlogFields;
     use tracing_subscriber::filter::EnvFilter;
diff --git a/ractor/rustfmt.toml b/ractor/rustfmt.toml
deleted file mode 100644
index 89b1c6c..0000000
--- a/ractor/rustfmt.toml
+++ /dev/null
@@ -1,4 +0,0 @@
-# To format doc tests, you need to run cargo +nightly fmt
-# and uncomment the following line
-#
-# format_code_in_doc_comments = true
\ No newline at end of file
diff --git a/ractor/src/actor.rs b/ractor/src/actor.rs
index 27c7448..adee777 100644
--- a/ractor/src/actor.rs
+++ b/ractor/src/actor.rs
@@ -78,11 +78,19 @@ mod supervision_tests;
 #[cfg(test)]
 mod tests;
 
-use crate::errors::{ActorErr, ActorProcessingErr, MessagingErr, SpawnErr};
-use crate::{ActorName, Message, State};
-use actor_cell::{ActorCell, ActorPortSet, ActorStatus};
+use actor_cell::ActorCell;
+use actor_cell::ActorPortSet;
+use actor_cell::ActorStatus;
 use actor_ref::ActorRef;
 
+use crate::errors::ActorErr;
+use crate::errors::ActorProcessingErr;
+use crate::errors::MessagingErr;
+use crate::errors::SpawnErr;
+use crate::ActorName;
+use crate::Message;
+use crate::State;
+
 pub(crate) fn get_panic_string(e: Box<dyn std::any::Any + Send>) -> ActorProcessingErr {
     match e.downcast::<String>() {
         Ok(v) => From::from(*v),
diff --git a/ractor/src/actor/actor_cell.rs b/ractor/src/actor/actor_cell.rs
index 3b7031a..174141d 100644
--- a/ractor/src/actor/actor_cell.rs
+++ b/ractor/src/actor/actor_cell.rs
@@ -16,16 +16,23 @@ use std::sync::Arc;
 use futures::FutureExt;
 
 use super::actor_properties::MuxedMessage;
-use super::messages::{Signal, StopMessage};
+use super::messages::Signal;
+use super::messages::StopMessage;
 use super::SupervisionEvent;
 use crate::actor::actor_properties::ActorProperties;
-use crate::concurrency::{JoinHandle, MpscUnboundedReceiver as InputPortReceiver, OneshotReceiver};
+use crate::concurrency::JoinHandle;
+use crate::concurrency::MpscUnboundedReceiver as InputPortReceiver;
+use crate::concurrency::OneshotReceiver;
 use crate::errors::MessagingErr;
 #[cfg(feature = "cluster")]
 use crate::message::SerializedMessage;
-use crate::{Actor, ActorName, SpawnErr};
-use crate::{ActorId, Message};
-use crate::{ActorRef, RactorErr};
+use crate::Actor;
+use crate::ActorId;
+use crate::ActorName;
+use crate::ActorRef;
+use crate::Message;
+use crate::RactorErr;
+use crate::SpawnErr;
 
 /// [ActorStatus] represents the status of an actor's lifecycle
 #[derive(Debug, Clone, Eq, PartialEq, Copy, PartialOrd, Ord)]
diff --git a/ractor/src/actor/actor_id.rs b/ractor/src/actor/actor_id.rs
index 7a71711..8b23b13 100644
--- a/ractor/src/actor/actor_id.rs
+++ b/ractor/src/actor/actor_id.rs
@@ -10,7 +10,8 @@
 //! ActorIds are generally helpful in logging and pattern matching, but not directly
 //! used in addressing outside of `ractor_cluster` network-based call internals.
 
-use std::{fmt::Display, sync::atomic::AtomicU64};
+use std::fmt::Display;
+use std::sync::atomic::AtomicU64;
 
 /// An actor's globally unique identifier
 #[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
diff --git a/ractor/src/actor/actor_properties.rs b/ractor/src/actor/actor_properties.rs
index 4382971..0188700 100644
--- a/ractor/src/actor/actor_properties.rs
+++ b/ractor/src/actor/actor_properties.rs
@@ -3,20 +3,29 @@
 // This source code is licensed under both the MIT license found in the
 // LICENSE-MIT file in the root directory of this source tree.
 
-use std::sync::atomic::{AtomicU8, Ordering};
-use std::sync::{Arc, Mutex};
+use std::sync::atomic::AtomicU8;
+use std::sync::atomic::Ordering;
+use std::sync::Arc;
+use std::sync::Mutex;
 
 use crate::actor::messages::StopMessage;
 use crate::actor::supervision::SupervisionTree;
-use crate::concurrency::{
-    MpscUnboundedReceiver as InputPortReceiver, MpscUnboundedSender as InputPort, OneshotReceiver,
-    OneshotSender as OneshotInputPort,
-};
+use crate::concurrency as mpsc;
+use crate::concurrency::MpscUnboundedReceiver as InputPortReceiver;
+use crate::concurrency::MpscUnboundedSender as InputPort;
+use crate::concurrency::OneshotReceiver;
+use crate::concurrency::OneshotSender as OneshotInputPort;
 use crate::message::BoxedMessage;
 #[cfg(feature = "cluster")]
 use crate::message::SerializedMessage;
-use crate::{concurrency as mpsc, Message};
-use crate::{Actor, ActorId, ActorName, ActorStatus, MessagingErr, Signal, SupervisionEvent};
+use crate::Actor;
+use crate::ActorId;
+use crate::ActorName;
+use crate::ActorStatus;
+use crate::Message;
+use crate::MessagingErr;
+use crate::Signal;
+use crate::SupervisionEvent;
 
 /// A muxed-message wrapper which allows the message port to receive either a message or a drain
 /// request which is a point-in-time marker that the actor's input channel should be drained
diff --git a/ractor/src/actor/actor_ref.rs b/ractor/src/actor/actor_ref.rs
index a60b6f6..7caa648 100644
--- a/ractor/src/actor/actor_ref.rs
+++ b/ractor/src/actor/actor_ref.rs
@@ -7,9 +7,11 @@
 
 use std::marker::PhantomData;
 
-use crate::{ActorName, Message, MessagingErr, SupervisionEvent};
-
 use super::ActorCell;
+use crate::ActorName;
+use crate::Message;
+use crate::MessagingErr;
+use crate::SupervisionEvent;
 
 /// An [ActorRef] is a strongly-typed wrapper over an [ActorCell]
 /// to provide some syntactic wrapping on the requirement to pass
diff --git a/ractor/src/actor/derived_actor.rs b/ractor/src/actor/derived_actor.rs
index cedaf05..817bca0 100644
--- a/ractor/src/actor/derived_actor.rs
+++ b/ractor/src/actor/derived_actor.rs
@@ -7,9 +7,13 @@
 //! to its accepted type using [From]. It represents a subset of the messages supported
 //! by the original actor.
 
-use crate::{ActorCell, ActorRef, Message, MessagingErr};
 use std::sync::Arc;
 
+use crate::ActorCell;
+use crate::ActorRef;
+use crate::Message;
+use crate::MessagingErr;
+
 /// [DerivedActorRef] wraps an [ActorCell] to send messages that can be converted
 /// into its accepted type using [From]. [DerivedActorRef] allows to create isolation
 /// between actors by hiding the actual message type.
diff --git a/ractor/src/actor/supervision.rs b/ractor/src/actor/supervision.rs
index 2f78e9a..772d420 100644
--- a/ractor/src/actor/supervision.rs
+++ b/ractor/src/actor/supervision.rs
@@ -14,7 +14,8 @@
 use std::collections::HashMap;
 use std::sync::Mutex;
 
-use super::{actor_cell::ActorCell, messages::SupervisionEvent};
+use super::actor_cell::ActorCell;
+use super::messages::SupervisionEvent;
 use crate::ActorId;
 
 /// A supervision tree
diff --git a/ractor/src/concurrency/async_std_primitives.rs b/ractor/src/concurrency/async_std_primitives.rs
index c1d7b87..b2284bc 100644
--- a/ractor/src/concurrency/async_std_primitives.rs
+++ b/ractor/src/concurrency/async_std_primitives.rs
@@ -8,19 +8,19 @@
 //! We still rely on tokio for some core executor-independent parts
 //! such as channels (see: https://github.com/tokio-rs/tokio/issues/4232#issuecomment-968329443).
 
-use std::{
-    fmt::Debug,
-    future::Future,
-    pin::Pin,
-    sync::{
-        atomic::{AtomicBool, Ordering},
-        Arc,
-    },
-    task::{Context, Poll},
-};
-
+use std::fmt::Debug;
+use std::future::Future;
+use std::pin::Pin;
+use std::sync::atomic::AtomicBool;
+use std::sync::atomic::Ordering;
+use std::sync::Arc;
+use std::task::Context;
+use std::task::Poll;
+
+use futures::future::BoxFuture;
 use futures::stream::FuturesUnordered;
-use futures::{future::BoxFuture, FutureExt, StreamExt};
+use futures::FutureExt;
+use futures::StreamExt;
 
 /// Represents a [JoinHandle] on a spawned task.
 /// Adds some syntactic wrapping to support a JoinHandle
@@ -230,7 +230,6 @@ where
 
 /// test macro
 pub use async_std::test;
-
 pub use futures::select_biased as select;
 
 #[cfg(test)]
diff --git a/ractor/src/concurrency/tokio_primitives.rs b/ractor/src/concurrency/tokio_primitives.rs
index c227950..db8ad2e 100644
--- a/ractor/src/concurrency/tokio_primitives.rs
+++ b/ractor/src/concurrency/tokio_primitives.rs
@@ -97,6 +97,5 @@ macro_rules! select {
     }
 
 pub(crate) use select;
-
 // test macro
 pub use tokio::test;
diff --git a/ractor/src/concurrency/tokio_with_wasm_primitives.rs b/ractor/src/concurrency/tokio_with_wasm_primitives.rs
index 9bf7eb8..faa249e 100644
--- a/ractor/src/concurrency/tokio_with_wasm_primitives.rs
+++ b/ractor/src/concurrency/tokio_with_wasm_primitives.rs
@@ -99,7 +99,6 @@ macro_rules! select {
     }
 
 pub(crate) use select;
-
 // test macro
 #[cfg(test)]
 pub use wasm_bindgen_test::wasm_bindgen_test as test;
diff --git a/ractor/src/factory.rs b/ractor/src/factory.rs
index 4e36b2f..54db8ee 100644
--- a/ractor/src/factory.rs
+++ b/ractor/src/factory.rs
@@ -51,7 +51,10 @@
 //! ```rust
 //! use ractor::concurrency::Duration;
 //! use ractor::factory::*;
-//! use ractor::{Actor, ActorProcessingErr, ActorRef, RpcReplyPort};
+//! use ractor::Actor;
+//! use ractor::ActorProcessingErr;
+//! use ractor::ActorRef;
+//! use ractor::RpcReplyPort;
 //!
 //! #[derive(Debug)]
 //! enum ExampleMessage {
@@ -160,10 +163,12 @@
 
 use std::sync::Arc;
 
-use crate::concurrency::{Duration, Instant};
+use crate::concurrency::Duration;
+use crate::concurrency::Instant;
 #[cfg(feature = "cluster")]
 use crate::message::BoxedDowncastErr;
-use crate::{Message, RpcReplyPort};
+use crate::Message;
+use crate::RpcReplyPort;
 
 pub mod discard;
 pub mod factoryimpl;
@@ -179,19 +184,31 @@ pub mod worker;
 #[cfg(test)]
 mod tests;
 
-use stats::FactoryStatsLayer;
-
-pub use discard::{
-    DiscardHandler, DiscardMode, DiscardReason, DiscardSettings, DynamicDiscardController,
-};
-pub use factoryimpl::{Factory, FactoryArguments, FactoryArgumentsBuilder};
-pub use job::{Job, JobKey, JobOptions, MessageRetryStrategy, RetriableMessage};
+pub use discard::DiscardHandler;
+pub use discard::DiscardMode;
+pub use discard::DiscardReason;
+pub use discard::DiscardSettings;
+pub use discard::DynamicDiscardController;
+pub use factoryimpl::Factory;
+pub use factoryimpl::FactoryArguments;
+pub use factoryimpl::FactoryArgumentsBuilder;
+pub use job::Job;
+pub use job::JobKey;
+pub use job::JobOptions;
+pub use job::MessageRetryStrategy;
+pub use job::RetriableMessage;
 pub use lifecycle::FactoryLifecycleHooks;
-pub use ratelim::{LeakyBucketRateLimiter, RateLimitedRouter, RateLimiter};
-pub use worker::{
-    DeadMansSwitchConfiguration, Worker, WorkerBuilder, WorkerCapacityController, WorkerMessage,
-    WorkerProperties, WorkerStartContext,
-};
+pub use ratelim::LeakyBucketRateLimiter;
+pub use ratelim::RateLimitedRouter;
+pub use ratelim::RateLimiter;
+use stats::FactoryStatsLayer;
+pub use worker::DeadMansSwitchConfiguration;
+pub use worker::Worker;
+pub use worker::WorkerBuilder;
+pub use worker::WorkerCapacityController;
+pub use worker::WorkerMessage;
+pub use worker::WorkerProperties;
+pub use worker::WorkerStartContext;
 
 /// The settings to change for an update request to the factory at runtime.
 ///
diff --git a/ractor/src/factory/factoryimpl.rs b/ractor/src/factory/factoryimpl.rs
index 3105ed7..bb15264 100644
--- a/ractor/src/factory/factoryimpl.rs
+++ b/ractor/src/factory/factoryimpl.rs
@@ -12,6 +12,9 @@ use std::marker::PhantomData;
 use std::sync::Arc;
 
 use self::routing::RouteResult;
+use super::queues::Queue;
+use super::routing::Router;
+use super::*;
 use crate::concurrency::Duration;
 use crate::concurrency::Instant;
 use crate::Actor;
@@ -21,10 +24,6 @@ use crate::Message;
 use crate::SpawnErr;
 use crate::SupervisionEvent;
 
-use super::queues::Queue;
-use super::routing::Router;
-use super::*;
-
 /// The global execution limit, any more than 1M and realistically
 /// we'll get into scheduling problems unless the requests have an
 /// incredibly low reception rate and high processing latency. At
diff --git a/ractor/src/factory/hash.rs b/ractor/src/factory/hash.rs
index af5375d..916dbe1 100644
--- a/ractor/src/factory/hash.rs
+++ b/ractor/src/factory/hash.rs
@@ -7,7 +7,8 @@
 //! space
 
 use std::collections::hash_map::DefaultHasher;
-use std::hash::{Hash, Hasher};
+use std::hash::Hash;
+use std::hash::Hasher;
 
 /// Hash a key into a finite space
 pub fn hash_with_max<TKey>(key: &TKey, excluded_max: usize) -> usize
diff --git a/ractor/src/factory/job.rs b/ractor/src/factory/job.rs
index 3c59078..5d1fe7c 100644
--- a/ractor/src/factory/job.rs
+++ b/ractor/src/factory/job.rs
@@ -5,7 +5,6 @@
 
 //! Specification for a [Job] sent to a factory
 
-use crate::concurrency::SystemTime;
 use std::fmt::Debug;
 use std::hash::Hash;
 use std::panic::RefUnwindSafe;
@@ -14,13 +13,16 @@ use std::sync::Arc;
 use bon::Builder;
 use tracing::Span;
 
-use crate::{concurrency::Duration, Message};
-use crate::{ActorRef, RpcReplyPort};
-
-#[cfg(feature = "cluster")]
-use crate::{message::BoxedDowncastErr, BytesConvertable};
-
 use super::FactoryMessage;
+use crate::concurrency::Duration;
+use crate::concurrency::SystemTime;
+#[cfg(feature = "cluster")]
+use crate::message::BoxedDowncastErr;
+use crate::ActorRef;
+#[cfg(feature = "cluster")]
+use crate::BytesConvertable;
+use crate::Message;
+use crate::RpcReplyPort;
 
 /// Represents a key to a job. Needs to be hashable for routing properties. Additionally needs
 /// to be serializable for remote factories
@@ -620,10 +622,12 @@ impl<TKey: JobKey, TMessage: Message> RetriableMessage<TKey, TMessage> {
 mod tests {
     use super::super::FactoryMessage;
     use super::Job;
-    use crate::{
-        concurrency::Duration, factory::JobOptions, serialization::BytesConvertable, Message,
-    };
-    use crate::{message::SerializedMessage, RpcReplyPort};
+    use crate::concurrency::Duration;
+    use crate::factory::JobOptions;
+    use crate::message::SerializedMessage;
+    use crate::serialization::BytesConvertable;
+    use crate::Message;
+    use crate::RpcReplyPort;
 
     #[derive(Eq, Hash, PartialEq, Clone, Debug)]
     struct TestKey {
diff --git a/ractor/src/factory/lifecycle.rs b/ractor/src/factory/lifecycle.rs
index 31c2063..66fce84 100644
--- a/ractor/src/factory/lifecycle.rs
+++ b/ractor/src/factory/lifecycle.rs
@@ -7,14 +7,17 @@
 //! lifecycle (startup/shutdown/etc) such that users can intercept and
 //! adjust factory functionality at key interjection points.
 
+#[cfg(not(feature = "async-trait"))]
+use futures::future::BoxFuture;
+#[cfg(not(feature = "async-trait"))]
+use futures::FutureExt;
+
 use super::FactoryMessage;
 use super::JobKey;
 use crate::ActorProcessingErr;
 use crate::ActorRef;
 use crate::Message;
 use crate::State;
-#[cfg(not(feature = "async-trait"))]
-use futures::{future::BoxFuture, FutureExt};
 
 /// Hooks for [crate::factory::Factory] lifecycle events based on the
 /// underlying actor's lifecycle.
diff --git a/ractor/src/factory/queues.rs b/ractor/src/factory/queues.rs
index 6575cc9..83c4522 100644
--- a/ractor/src/factory/queues.rs
+++ b/ractor/src/factory/queues.rs
@@ -360,10 +360,9 @@ where
 
 #[cfg(test)]
 mod tests {
-    use crate::concurrency::Duration;
-
     use super::super::*;
     use super::*;
+    use crate::concurrency::Duration;
 
     #[derive(Default, Debug)]
     enum BasicPriority {
diff --git a/ractor/src/factory/ratelim.rs b/ractor/src/factory/ratelim.rs
index 734cf2a..edfa618 100644
--- a/ractor/src/factory/ratelim.rs
+++ b/ractor/src/factory/ratelim.rs
@@ -7,7 +7,8 @@
 
 use std::collections::HashMap;
 
-use crate::concurrency::{Duration, Instant};
+use crate::concurrency::Duration;
+use crate::concurrency::Instant;
 use crate::factory::routing::RouteResult;
 use crate::factory::routing::Router;
 use crate::factory::Job;
@@ -173,9 +174,8 @@ impl RateLimiter for LeakyBucketRateLimiter {
 
 #[cfg(test)]
 mod tests {
-    use crate::concurrency::sleep;
-
     use super::*;
+    use crate::concurrency::sleep;
 
     #[crate::concurrency::test]
     async fn test_basic_leaky_bucket() {
diff --git a/ractor/src/factory/stats.rs b/ractor/src/factory/stats.rs
index 6563325..6318a90 100644
--- a/ractor/src/factory/stats.rs
+++ b/ractor/src/factory/stats.rs
@@ -7,7 +7,8 @@
 
 use std::sync::Arc;
 
-use crate::concurrency::{Duration, Instant};
+use crate::concurrency::Duration;
+use crate::concurrency::Instant;
 use crate::factory::JobOptions;
 
 /// A wrapper over whatever stats collection a user wishes to utilize
diff --git a/ractor/src/factory/worker.rs b/ractor/src/factory/worker.rs
index 54712ab..8e4d16c 100644
--- a/ractor/src/factory/worker.rs
+++ b/ractor/src/factory/worker.rs
@@ -5,7 +5,8 @@
 
 //! Factory worker properties
 
-use std::collections::{HashMap, VecDeque};
+use std::collections::HashMap;
+use std::collections::VecDeque;
 use std::fmt::Debug;
 #[cfg(not(feature = "async-trait"))]
 use std::future::Future;
@@ -14,19 +15,29 @@ use std::sync::Arc;
 use bon::Builder;
 use tracing::Instrument;
 
-#[cfg(not(feature = "async-trait"))]
-use crate::concurrency::MaybeSend;
-use crate::concurrency::{Duration, Instant, JoinHandle};
-use crate::{Actor, ActorId, ActorProcessingErr};
-use crate::{ActorCell, ActorRef, Message, MessagingErr, SupervisionEvent};
-
-use super::discard::{DiscardMode, WorkerDiscardSettings};
+use super::discard::DiscardMode;
+use super::discard::WorkerDiscardSettings;
 use super::stats::FactoryStatsLayer;
+use super::DiscardHandler;
+use super::DiscardReason;
 use super::FactoryMessage;
 use super::Job;
 use super::JobKey;
+use super::JobOptions;
 use super::WorkerId;
-use super::{DiscardHandler, DiscardReason, JobOptions};
+use crate::concurrency::Duration;
+use crate::concurrency::Instant;
+use crate::concurrency::JoinHandle;
+#[cfg(not(feature = "async-trait"))]
+use crate::concurrency::MaybeSend;
+use crate::Actor;
+use crate::ActorCell;
+use crate::ActorId;
+use crate::ActorProcessingErr;
+use crate::ActorRef;
+use crate::Message;
+use crate::MessagingErr;
+use crate::SupervisionEvent;
 
 /// The configuration for the dead-man's switch functionality
 #[derive(Builder, Debug)]
diff --git a/ractor/src/lib.rs b/ractor/src/lib.rs
index 5fd18e9..478128f 100644
--- a/ractor/src/lib.rs
+++ b/ractor/src/lib.rs
@@ -23,7 +23,9 @@
 //! An example "ping-pong" actor might be the following
 //!
 //! ```rust
-//! use ractor::{Actor, ActorProcessingErr, ActorRef};
+//! use ractor::Actor;
+//! use ractor::ActorProcessingErr;
+//! use ractor::ActorRef;
 //!
 //! /// [PingPong] is a basic actor that will print
 //! /// ping..pong.. repeatedly until some exit
@@ -193,33 +195,41 @@ use strum as _;
 
 #[cfg(test)]
 mod tests;
+// ======================== Re-exports ======================== //
+pub use actor::actor_cell::ActorCell;
+pub use actor::actor_cell::ActorStatus;
+pub use actor::actor_cell::ACTIVE_STATES;
+pub use actor::actor_id::ActorId;
+pub use actor::actor_ref::ActorRef;
+pub use actor::derived_actor::DerivedActorRef;
+pub use actor::messages::Signal;
+pub use actor::messages::SupervisionEvent;
+pub use actor::Actor;
+pub use actor::ActorRuntime;
+#[cfg(feature = "async-trait")]
+pub use async_trait::async_trait;
 #[cfg(test)]
 use criterion as _;
+pub use errors::ActorErr;
+pub use errors::ActorProcessingErr;
+pub use errors::MessagingErr;
+pub use errors::RactorErr;
+pub use errors::SpawnErr;
+pub use message::Message;
 #[cfg(test)]
 use paste as _;
+pub use port::OutputMessage;
+pub use port::OutputPort;
+pub use port::RpcReplyPort;
 #[cfg(test)]
 use rand as _;
+#[cfg(feature = "cluster")]
+pub use serialization::BytesConvertable;
 #[cfg(test)]
 use tracing_glog as _;
 #[cfg(test)]
 use tracing_subscriber as _;
 
-// ======================== Re-exports ======================== //
-
-pub use actor::actor_cell::{ActorCell, ActorStatus, ACTIVE_STATES};
-pub use actor::actor_id::ActorId;
-pub use actor::actor_ref::ActorRef;
-pub use actor::derived_actor::DerivedActorRef;
-pub use actor::messages::{Signal, SupervisionEvent};
-pub use actor::{Actor, ActorRuntime};
-#[cfg(feature = "async-trait")]
-pub use async_trait::async_trait;
-pub use errors::{ActorErr, ActorProcessingErr, MessagingErr, RactorErr, SpawnErr};
-pub use message::Message;
-pub use port::{OutputMessage, OutputPort, RpcReplyPort};
-#[cfg(feature = "cluster")]
-pub use serialization::BytesConvertable;
-
 // ======================== Type aliases and Trait definitions ======================== //
 
 /// An actor's name, equivalent to an [Erlang `atom()`](https://www.erlang.org/doc/reference_manual/data_types.html#atom)
diff --git a/ractor/src/pg.rs b/ractor/src/pg.rs
index 8c5bd4e..425d7bb 100644
--- a/ractor/src/pg.rs
+++ b/ractor/src/pg.rs
@@ -22,7 +22,9 @@
 //!
 //! ```rust
 //! use ractor::pg;
-//! use ractor::{Actor, ActorProcessingErr, ActorRef};
+//! use ractor::Actor;
+//! use ractor::ActorProcessingErr;
+//! use ractor::ActorRef;
 //!
 //! struct ExampleActor;
 //!
@@ -71,12 +73,16 @@
 use std::collections::HashMap;
 use std::sync::Arc;
 
-use dashmap::mapref::entry::Entry::{Occupied, Vacant};
+use dashmap::mapref::entry::Entry::Occupied;
+use dashmap::mapref::entry::Entry::Vacant;
 use dashmap::DashMap;
-
 use once_cell::sync::OnceCell;
 
-use crate::{ActorCell, ActorId, GroupName, ScopeName, SupervisionEvent};
+use crate::ActorCell;
+use crate::ActorId;
+use crate::GroupName;
+use crate::ScopeName;
+use crate::SupervisionEvent;
 
 /// Key to set the default scope
 pub const DEFAULT_SCOPE: &str = "__default_scope__";
diff --git a/ractor/src/port.rs b/ractor/src/port.rs
index 63aa50e..320b4e5 100644
--- a/ractor/src/port.rs
+++ b/ractor/src/port.rs
@@ -11,7 +11,6 @@
 //! the actor framework.
 
 use crate::concurrency;
-
 use crate::MessagingErr;
 
 // ============ Output Ports ============ //
diff --git a/ractor/src/port/output.rs b/ractor/src/port/output.rs
index 02ad2f1..167d440 100644
--- a/ractor/src/port/output.rs
+++ b/ractor/src/port/output.rs
@@ -10,12 +10,14 @@
 //! to them which are automatically forwarded to downstream actors waiting for inputs. They optionally
 //! have a message transformer attached to them to convert them to the appropriate message type
 
-use std::{fmt::Debug, sync::RwLock};
+use std::fmt::Debug;
+use std::sync::RwLock;
 
-use crate::concurrency::JoinHandle;
 use tokio::sync::broadcast as pubsub;
 
-use crate::{ActorRef, Message};
+use crate::concurrency::JoinHandle;
+use crate::ActorRef;
+use crate::Message;
 
 #[cfg(test)]
 mod tests;
diff --git a/ractor/src/registry.rs b/ractor/src/registry.rs
index 6ceb90d..b3ca400 100644
--- a/ractor/src/registry.rs
+++ b/ractor/src/registry.rs
@@ -37,7 +37,9 @@
 //!
 //! ```rust
 //! use ractor::registry;
-//! use ractor::{Actor, ActorProcessingErr, ActorRef};
+//! use ractor::Actor;
+//! use ractor::ActorProcessingErr;
+//! use ractor::ActorRef;
 //!
 //! struct ExampleActor;
 //!
@@ -80,16 +82,22 @@
 
 use std::sync::Arc;
 
-use dashmap::mapref::entry::Entry::{Occupied, Vacant};
+use dashmap::mapref::entry::Entry::Occupied;
+use dashmap::mapref::entry::Entry::Vacant;
 use dashmap::DashMap;
 use once_cell::sync::OnceCell;
 
-use crate::{ActorCell, ActorName};
+use crate::ActorCell;
+use crate::ActorName;
 
 #[cfg(feature = "cluster")]
 pub mod pid_registry;
 #[cfg(feature = "cluster")]
-pub use pid_registry::{get_all_pids, where_is_pid, PidLifecycleEvent};
+pub use pid_registry::get_all_pids;
+#[cfg(feature = "cluster")]
+pub use pid_registry::where_is_pid;
+#[cfg(feature = "cluster")]
+pub use pid_registry::PidLifecycleEvent;
 
 #[cfg(test)]
 mod tests;
diff --git a/ractor/src/registry/pid_registry.rs b/ractor/src/registry/pid_registry.rs
index 1412e53..74e394b 100644
--- a/ractor/src/registry/pid_registry.rs
+++ b/ractor/src/registry/pid_registry.rs
@@ -9,11 +9,14 @@
 use std::fmt::Debug;
 use std::sync::Arc;
 
-use dashmap::mapref::entry::Entry::{Occupied, Vacant};
+use dashmap::mapref::entry::Entry::Occupied;
+use dashmap::mapref::entry::Entry::Vacant;
 use dashmap::DashMap;
 use once_cell::sync::OnceCell;
 
-use crate::{ActorCell, ActorId, SupervisionEvent};
+use crate::ActorCell;
+use crate::ActorId;
+use crate::SupervisionEvent;
 
 /// Represents a change ocurring to some actor in the global process registry. Only relevant in
 /// cluster enabled functionality.
diff --git a/ractor/src/rpc.rs b/ractor/src/rpc.rs
index ee56335..d60c3e1 100644
--- a/ractor/src/rpc.rs
+++ b/ractor/src/rpc.rs
@@ -13,9 +13,14 @@
 //! ## Examples
 //!
 //! ```rust
+//! use ractor::call;
+//! use ractor::call_t;
+//! use ractor::cast;
 //! use ractor::concurrency::Duration;
-//! use ractor::{call, call_t, cast};
-//! use ractor::{Actor, ActorProcessingErr, ActorRef, RpcReplyPort};
+//! use ractor::Actor;
+//! use ractor::ActorProcessingErr;
+//! use ractor::ActorRef;
+//! use ractor::RpcReplyPort;
 //!
 //! struct ExampleActor;
 //!
@@ -87,9 +92,15 @@
 //! }
 //! ```
 
-use crate::concurrency::{self, Duration, JoinHandle};
-
-use crate::{ActorCell, ActorRef, DerivedActorRef, Message, MessagingErr, RpcReplyPort};
+use crate::concurrency::Duration;
+use crate::concurrency::JoinHandle;
+use crate::concurrency::{self};
+use crate::ActorCell;
+use crate::ActorRef;
+use crate::DerivedActorRef;
+use crate::Message;
+use crate::MessagingErr;
+use crate::RpcReplyPort;
 
 pub mod call_result;
 pub use call_result::CallResult;
diff --git a/ractor/src/serialization.rs b/ractor/src/serialization.rs
index 3545249..3dfd082 100644
--- a/ractor/src/serialization.rs
+++ b/ractor/src/serialization.rs
@@ -203,9 +203,13 @@ mod impls {
 
 #[cfg(test)]
 mod tests {
+    use rand::distributions::Alphanumeric;
+    use rand::thread_rng;
+    use rand::Rng;
+
     use super::BytesConvertable;
-    use crate::{message::BoxedDowncastErr, Message};
-    use rand::{distributions::Alphanumeric, thread_rng, Rng};
+    use crate::message::BoxedDowncastErr;
+    use crate::Message;
 
     fn random_string() -> String {
         thread_rng()
diff --git a/ractor/src/thread_local/inner.rs b/ractor/src/thread_local/inner.rs
index d11aa85..36856b0 100644
--- a/ractor/src/thread_local/inner.rs
+++ b/ractor/src/thread_local/inner.rs
@@ -15,6 +15,8 @@ use futures::FutureExt;
 use futures::TryFutureExt;
 use tracing::Instrument;
 
+use super::ThreadLocalActor;
+use super::ThreadLocalActorSpawner;
 use crate::actor::actor_cell;
 use crate::actor::actor_cell::ActorPortSet;
 use crate::actor::actor_properties::ActorProperties;
@@ -38,9 +40,6 @@ use crate::Signal;
 use crate::SpawnErr;
 use crate::SupervisionEvent;
 
-use super::ThreadLocalActor;
-use super::ThreadLocalActorSpawner;
-
 impl ActorCell {
     pub(crate) fn new_thread_local<TActor>(
         name: Option<ActorName>,
diff --git a/ractor/src/time.rs b/ractor/src/time.rs
index 538d3bd..d6d0119 100644
--- a/ractor/src/time.rs
+++ b/ractor/src/time.rs
@@ -18,7 +18,9 @@
 //!
 //! ```rust
 //! use ractor::concurrency::Duration;
-//! use ractor::{Actor, ActorProcessingErr, ActorRef};
+//! use ractor::Actor;
+//! use ractor::ActorProcessingErr;
+//! use ractor::ActorRef;
 //!
 //! struct ExampleActor;
 //!
@@ -83,9 +85,12 @@
 //! }
 //! ```
 
-use crate::concurrency::{Duration, JoinHandle};
-
-use crate::{ActorCell, Message, MessagingErr, ACTIVE_STATES};
+use crate::concurrency::Duration;
+use crate::concurrency::JoinHandle;
+use crate::ActorCell;
+use crate::Message;
+use crate::MessagingErr;
+use crate::ACTIVE_STATES;
 
 #[cfg(test)]
 mod tests;
diff --git a/ractor_cluster/src/lib.rs b/ractor_cluster/src/lib.rs
index 3919244..0160a20 100644
--- a/ractor_cluster/src/lib.rs
+++ b/ractor_cluster/src/lib.rs
@@ -41,7 +41,6 @@
 //! serialization is handled. There however is a procedural macro in `ractor_cluster_derive` to facilitate this, which is
 //! re-exposed on this crate under the same naming. Simply derive [RactorMessage] or [RactorClusterMessage] if you want local or
 //! remote-supporting messages, respectively.
-//!
 
 #![warn(
     dead_code,
@@ -73,18 +72,17 @@ pub type NodeId = u64;
 // Satisfy dependencies transitively imported
 #[cfg(feature = "async-trait")]
 use async_trait as _;
-
 // ============== Re-exports ============== //
 pub use net::{IncomingEncryptionMode, NetworkStream};
 pub use node::client::connect as client_connect;
 pub use node::client::connect_enc as client_connect_enc;
-pub use node::{
-    client::ClientConnectErr, NodeEventSubscription, NodeServer, NodeServerMessage, NodeSession,
-    NodeSessionMessage,
-};
-
+pub use node::client::ClientConnectErr;
+pub use node::NodeEventSubscription;
+pub use node::NodeServer;
+pub use node::NodeServerMessage;
+pub use node::NodeSession;
+pub use node::NodeSessionMessage;
+pub use ractor::serialization::*;
 // Re-export the procedural macros so people don't need to reference them directly
 pub use ractor_cluster_derive::RactorClusterMessage;
 pub use ractor_cluster_derive::RactorMessage;
-
-pub use ractor::serialization::*;
diff --git a/ractor_cluster/src/net.rs b/ractor_cluster/src/net.rs
index 7dcadd4..486fdab 100644
--- a/ractor_cluster/src/net.rs
+++ b/ractor_cluster/src/net.rs
@@ -12,8 +12,10 @@ use tokio::net::TcpStream;
 mod listener;
 mod session;
 
-pub(crate) use listener::{Listener, ListenerMessage};
-pub(crate) use session::{Session, SessionMessage};
+pub(crate) use listener::Listener;
+pub(crate) use listener::ListenerMessage;
+pub(crate) use session::Session;
+pub(crate) use session::SessionMessage;
 
 /// A network port
 pub(crate) type NetworkPort = u16;
diff --git a/ractor_cluster/src/net/listener.rs b/ractor_cluster/src/net/listener.rs
index a2cfbe2..13d28a4 100644
--- a/ractor_cluster/src/net/listener.rs
+++ b/ractor_cluster/src/net/listener.rs
@@ -5,8 +5,10 @@
 
 //! TCP Server to accept incoming sessions
 
-use ractor::{cast, ActorProcessingErr};
-use ractor::{Actor, ActorRef};
+use ractor::cast;
+use ractor::Actor;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
 use tokio::net::TcpListener;
 
 use super::IncomingEncryptionMode;
diff --git a/ractor_cluster/src/net/session.rs b/ractor_cluster/src/net/session.rs
index 41d421b..72f191e 100644
--- a/ractor_cluster/src/net/session.rs
+++ b/ractor_cluster/src/net/session.rs
@@ -12,11 +12,18 @@ use std::net::SocketAddr;
 
 use bytes::Bytes;
 use prost::Message;
-use ractor::{Actor, ActorCell, ActorProcessingErr, ActorRef};
-use ractor::{SpawnErr, SupervisionEvent};
+use ractor::Actor;
+use ractor::ActorCell;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
+use ractor::SpawnErr;
+use ractor::SupervisionEvent;
+use tokio::io::AsyncReadExt;
 use tokio::io::ErrorKind;
-use tokio::io::{AsyncReadExt, ReadHalf, WriteHalf};
-use tokio::net::tcp::{OwnedReadHalf, OwnedWriteHalf};
+use tokio::io::ReadHalf;
+use tokio::io::WriteHalf;
+use tokio::net::tcp::OwnedReadHalf;
+use tokio::net::tcp::OwnedWriteHalf;
 use tokio::net::TcpStream;
 
 use crate::RactorMessage;
diff --git a/ractor_cluster/src/node.rs b/ractor_cluster/src/node.rs
index 5a5b20c..698287c 100644
--- a/ractor_cluster/src/node.rs
+++ b/ractor_cluster/src/node.rs
@@ -35,7 +35,6 @@
 //! -> If either child actor closes, then it will terminate the overall `ractor_cluster::net::session::Session` which in
 //!    turn will terminate the [NodeSession] and the [NodeServer] will de-register the [NodeSession] from its
 //!    internal state
-//!
 
 /*
 What's there to do? See tracking issue <https://github.com/slawlor/ractor/issues/16> for the most
@@ -47,16 +46,22 @@ up-to-date information on the status of remoting and actors
 pub mod auth;
 pub mod client;
 pub mod node_session;
-pub use node_session::NodeSession;
-
+use std::cmp::Ordering;
+use std::collections::hash_map::Entry;
 use std::collections::HashMap;
-use std::{cmp::Ordering, collections::hash_map::Entry};
 
-use ractor::{Actor, ActorId, ActorProcessingErr, ActorRef, RpcReplyPort, SupervisionEvent};
+pub use node_session::NodeSession;
+use ractor::Actor;
+use ractor::ActorId;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
+use ractor::RpcReplyPort;
+use ractor::SupervisionEvent;
 
 use crate::net::IncomingEncryptionMode;
 use crate::protocol::auth as auth_protocol;
-use crate::{NodeId, RactorMessage};
+use crate::NodeId;
+use crate::RactorMessage;
 
 const PROTOCOL_VERSION: u32 = 1;
 
diff --git a/ractor_cluster/src/node/auth.rs b/ractor_cluster/src/node/auth.rs
index a158e4c..de8b5ce 100644
--- a/ractor_cluster/src/node/auth.rs
+++ b/ractor_cluster/src/node/auth.rs
@@ -171,9 +171,8 @@ impl ClientAuthenticationProcess {
 
 #[cfg(test)]
 mod tests {
-    use crate::protocol::auth::NodeFlags;
-
     use super::*;
+    use crate::protocol::auth::NodeFlags;
 
     #[test]
     fn server_auth_state() {
diff --git a/ractor_cluster/src/node/client.rs b/ractor_cluster/src/node/client.rs
index 777582b..9b22e9e 100644
--- a/ractor_cluster/src/node/client.rs
+++ b/ractor_cluster/src/node/client.rs
@@ -7,8 +7,10 @@
 
 use std::fmt::Display;
 
-use ractor::{ActorRef, MessagingErr};
-use tokio::net::{TcpStream, ToSocketAddrs};
+use ractor::ActorRef;
+use ractor::MessagingErr;
+use tokio::net::TcpStream;
+use tokio::net::ToSocketAddrs;
 use tokio_rustls::rustls::pki_types::ServerName;
 
 /// A client connection error. Possible issues are Socket connection
diff --git a/ractor_cluster/src/node/node_session.rs b/ractor_cluster/src/node/node_session.rs
index 292345d..48bbfb1 100644
--- a/ractor_cluster/src/node/node_session.rs
+++ b/ractor_cluster/src/node/node_session.rs
@@ -7,16 +7,25 @@
 //! `node()`s and all of its authentication and communication for that
 //! pairing
 
-use std::collections::{HashMap, HashSet};
+use std::collections::HashMap;
+use std::collections::HashSet;
 use std::convert::TryInto;
 use std::net::SocketAddr;
-use std::time::{Instant, SystemTime};
+use std::time::Instant;
+use std::time::SystemTime;
 
 use ractor::message::SerializedMessage;
-use ractor::pg::{get_scoped_local_members, which_scopes_and_groups, GroupChangeMessage};
+use ractor::pg::get_scoped_local_members;
+use ractor::pg::which_scopes_and_groups;
+use ractor::pg::GroupChangeMessage;
 use ractor::registry::PidLifecycleEvent;
 use ractor::rpc::CallResult;
-use ractor::{Actor, ActorId, ActorProcessingErr, ActorRef, SpawnErr, SupervisionEvent};
+use ractor::Actor;
+use ractor::ActorId;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
+use ractor::SpawnErr;
+use ractor::SupervisionEvent;
 use rand::Rng;
 use tokio::time::Duration;
 
@@ -26,7 +35,8 @@ use crate::node::NodeConnectionMode;
 use crate::protocol::auth as auth_protocol;
 use crate::protocol::control as control_protocol;
 use crate::protocol::node as node_protocol;
-use crate::remote_actor::{RemoteActor, RemoteActorMessage};
+use crate::remote_actor::RemoteActor;
+use crate::remote_actor::RemoteActorMessage;
 use crate::NodeServerMessage;
 
 const MIN_PING_LATENCY_MS: u64 = 1000;
diff --git a/ractor_cluster/src/remote_actor.rs b/ractor_cluster/src/remote_actor.rs
index 541c6aa..949197d 100644
--- a/ractor_cluster/src/remote_actor.rs
+++ b/ractor_cluster/src/remote_actor.rs
@@ -9,10 +9,17 @@
 
 use std::collections::HashMap;
 
+use ractor::cast;
 use ractor::concurrency::JoinHandle;
 use ractor::message::SerializedMessage;
-use ractor::{cast, ActorProcessingErr};
-use ractor::{Actor, ActorCell, ActorId, ActorName, ActorRef, RpcReplyPort, SpawnErr};
+use ractor::Actor;
+use ractor::ActorCell;
+use ractor::ActorId;
+use ractor::ActorName;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
+use ractor::RpcReplyPort;
+use ractor::SpawnErr;
 use ractor_cluster_derive::RactorMessage;
 
 use crate::node::NodeSessionMessage;
diff --git a/ractor_cluster_derive/src/lib.rs b/ractor_cluster_derive/src/lib.rs
index fa8204b..bef505e 100644
--- a/ractor_cluster_derive/src/lib.rs
+++ b/ractor_cluster_derive/src/lib.rs
@@ -26,8 +26,16 @@
 
 extern crate proc_macro;
 use proc_macro::TokenStream;
-use quote::{format_ident, quote, ToTokens};
-use syn::{self, AngleBracketedGenericArguments, DeriveInput, Fields, Ident, TypePath, Variant};
+use quote::format_ident;
+use quote::quote;
+use quote::ToTokens;
+use syn::AngleBracketedGenericArguments;
+use syn::DeriveInput;
+use syn::Fields;
+use syn::Ident;
+use syn::TypePath;
+use syn::Variant;
+use syn::{self};
 
 /// Derive `ractor::Message` for messages that are local-only
 #[proc_macro_derive(RactorMessage)]
@@ -53,7 +61,6 @@ pub fn ractor_message_derive_macro(input: TokenStream) -> TokenStream {
 /// 4. Lastly, for RPCs, they should additionally be decorated with `#[rpc]` on each variant's definition. This helps the macro identify that it
 ///    is an RPC and will need port handler
 /// 5. For backwards compatibility, you can add new variants as long as you don't rename variants until all nodes in the cluster are upgraded.
-///
 #[proc_macro_derive(RactorClusterMessage, attributes(rpc))]
 pub fn ractor_cluster_message_derive_macro(input: TokenStream) -> TokenStream {
     // Construct a representation of Rust code as a syntax tree
diff --git a/ractor_example_entry_proc/src/lib.rs b/ractor_example_entry_proc/src/lib.rs
index 663ff20..db253f2 100644
--- a/ractor_example_entry_proc/src/lib.rs
+++ b/ractor_example_entry_proc/src/lib.rs
@@ -5,7 +5,8 @@
 
 use proc_macro::TokenStream;
 use quote::quote;
-use syn::{parse_macro_input, ItemFn};
+use syn::parse_macro_input;
+use syn::ItemFn;
 
 /// Expands to `#[tokio::main(flavor = "current_thread")]` on `wasm32-unknown-unknown`, `#[tokio::main]` on other platforms
 #[proc_macro_attribute]
diff --git a/ractor_playground/src/distributed.rs b/ractor_playground/src/distributed.rs
index 4dbc4f7..faa91d1 100644
--- a/ractor_playground/src/distributed.rs
+++ b/ractor_playground/src/distributed.rs
@@ -5,8 +5,11 @@
 
 //! Distributed cluster playground
 
+use ractor::concurrency::Duration;
+use ractor::Actor;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
 use ractor::RpcReplyPort;
-use ractor::{concurrency::Duration, Actor, ActorProcessingErr, ActorRef};
 use ractor_cluster::RactorClusterMessage;
 
 /// Run test with
diff --git a/ractor_playground/src/ping_pong.rs b/ractor_playground/src/ping_pong.rs
index 4278da8..d2e69bd 100644
--- a/ractor_playground/src/ping_pong.rs
+++ b/ractor_playground/src/ping_pong.rs
@@ -5,7 +5,9 @@
 
 //! A ping-pong actor implementation
 
-use ractor::{Actor, ActorProcessingErr, ActorRef};
+use ractor::Actor;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
 
 pub struct PingPong;
 
diff --git a/rustfmt.toml b/rustfmt.toml
new file mode 100644
index 0000000..2998dc2
--- /dev/null
+++ b/rustfmt.toml
@@ -0,0 +1,7 @@
+# To format doc tests, you need to run cargo +nightly fmt
+# and uncomment the following line
+#
+# format_code_in_doc_comments = true
+# imports_granularity = "Item"
+# reorder_imports = true
+# group_imports = "StdExternalCrate"
\ No newline at end of file


Test patch:
diff --git a/ractor/src/actor/supervision_tests.rs b/ractor/src/actor/supervision_tests.rs
index 272043f..25e3238 100644
--- a/ractor/src/actor/supervision_tests.rs
+++ b/ractor/src/actor/supervision_tests.rs
@@ -5,14 +5,20 @@
 
 //! Supervisor tests
 
-use std::sync::{
-    atomic::{AtomicU64, AtomicU8, Ordering},
-    Arc,
-};
-
-use crate::{concurrency::Duration, message::BoxedDowncastErr, periodic_check, ActorProcessingErr};
-
-use crate::{Actor, ActorCell, ActorRef, ActorStatus, SupervisionEvent};
+use std::sync::atomic::AtomicU64;
+use std::sync::atomic::AtomicU8;
+use std::sync::atomic::Ordering;
+use std::sync::Arc;
+
+use crate::concurrency::Duration;
+use crate::message::BoxedDowncastErr;
+use crate::periodic_check;
+use crate::Actor;
+use crate::ActorCell;
+use crate::ActorProcessingErr;
+use crate::ActorRef;
+use crate::ActorStatus;
+use crate::SupervisionEvent;
 
 #[crate::concurrency::test]
 #[cfg_attr(
diff --git a/ractor/src/actor/tests.rs b/ractor/src/actor/tests.rs
index ad1273c..5a446b0 100644
--- a/ractor/src/actor/tests.rs
+++ b/ractor/src/actor/tests.rs
@@ -5,21 +5,24 @@
 
 //! General tests, more logic-specific tests are contained in sub-modules
 
-use std::sync::{
-    atomic::{AtomicU32, AtomicU8, Ordering},
-    Arc,
-};
-
-use crate::{
-    actor::derived_actor::DerivedActorRef,
-    common_test::periodic_check,
-    concurrency::{sleep, Duration},
-    MessagingErr, RactorErr,
-};
-
-use crate::{
-    Actor, ActorCell, ActorProcessingErr, ActorRef, ActorStatus, SpawnErr, SupervisionEvent,
-};
+use std::sync::atomic::AtomicU32;
+use std::sync::atomic::AtomicU8;
+use std::sync::atomic::Ordering;
+use std::sync::Arc;
+
+use crate::actor::derived_actor::DerivedActorRef;
+use crate::common_test::periodic_check;
+use crate::concurrency::sleep;
+use crate::concurrency::Duration;
+use crate::Actor;
+use crate::ActorCell;
+use crate::ActorProcessingErr;
+use crate::ActorRef;
+use crate::ActorStatus;
+use crate::MessagingErr;
+use crate::RactorErr;
+use crate::SpawnErr;
+use crate::SupervisionEvent;
 
 struct EmptyMessage;
 #[cfg(feature = "cluster")]
@@ -428,7 +431,8 @@ async fn test_sending_message_to_dead_actor() {
     tracing_test::traced_test
 )]
 async fn test_serialized_cast() {
-    use crate::message::{BoxedDowncastErr, SerializedMessage};
+    use crate::message::BoxedDowncastErr;
+    use crate::message::SerializedMessage;
     use crate::Message;
 
     let counter = Arc::new(AtomicU8::new(0));
@@ -546,8 +550,10 @@ where
     tracing_test::traced_test
 )]
 async fn test_serialized_rpc() {
-    use crate::message::{BoxedDowncastErr, SerializedMessage};
-    use crate::{Message, RpcReplyPort};
+    use crate::message::BoxedDowncastErr;
+    use crate::message::SerializedMessage;
+    use crate::Message;
+    use crate::RpcReplyPort;
 
     let counter = Arc::new(AtomicU8::new(0));
 
@@ -659,8 +665,11 @@ async fn test_serialized_rpc() {
     tracing_test::traced_test
 )]
 async fn test_remote_actor() {
-    use crate::message::{BoxedDowncastErr, SerializedMessage};
-    use crate::{ActorId, ActorRuntime, Message};
+    use crate::message::BoxedDowncastErr;
+    use crate::message::SerializedMessage;
+    use crate::ActorId;
+    use crate::ActorRuntime;
+    use crate::Message;
 
     let counter = Arc::new(AtomicU8::new(0));
 
diff --git a/ractor/src/factory/tests/basic.rs b/ractor/src/factory/tests/basic.rs
index c0c23b3..a4e83f3 100644
--- a/ractor/src/factory/tests/basic.rs
+++ b/ractor/src/factory/tests/basic.rs
@@ -9,13 +9,12 @@ use std::sync::atomic::Ordering;
 use std::sync::Arc;
 
 use crate::concurrency::Duration;
-use crate::Actor;
-use crate::ActorProcessingErr;
-use crate::ActorRef;
-
 use crate::factory::routing::CustomHashFunction;
 use crate::factory::*;
 use crate::periodic_check;
+use crate::Actor;
+use crate::ActorProcessingErr;
+use crate::ActorRef;
 
 const NUM_TEST_WORKERS: usize = 3;
 
diff --git a/ractor/src/factory/tests/dynamic_discarding.rs b/ractor/src/factory/tests/dynamic_discarding.rs
index 9832684..64f439a 100644
--- a/ractor/src/factory/tests/dynamic_discarding.rs
+++ b/ractor/src/factory/tests/dynamic_discarding.rs
@@ -3,12 +3,15 @@
 // This source code is licensed under both the MIT license found in the
 // LICENSE-MIT file in the root directory of this source tree.
 
-#[cfg(not(feature = "async-trait"))]
-use futures::{future::BoxFuture, FutureExt};
 use std::sync::atomic::AtomicU16;
 use std::sync::atomic::Ordering;
 use std::sync::Arc;
 
+#[cfg(not(feature = "async-trait"))]
+use futures::future::BoxFuture;
+#[cfg(not(feature = "async-trait"))]
+use futures::FutureExt;
+
 use crate::concurrency::Duration;
 use crate::factory::*;
 use crate::Actor;
diff --git a/ractor/src/factory/tests/dynamic_pool.rs b/ractor/src/factory/tests/dynamic_pool.rs
index 5fc7365..1eb220d 100644
--- a/ractor/src/factory/tests/dynamic_pool.rs
+++ b/ractor/src/factory/tests/dynamic_pool.rs
@@ -9,15 +9,16 @@
 use std::sync::Arc;
 
 #[cfg(not(feature = "async-trait"))]
-use futures::{future::BoxFuture, FutureExt};
+use futures::future::BoxFuture;
+#[cfg(not(feature = "async-trait"))]
+use futures::FutureExt;
 
 use crate::concurrency::Duration;
+use crate::factory::*;
 use crate::Actor;
 use crate::ActorProcessingErr;
 use crate::ActorRef;
 
-use crate::factory::*;
-
 #[derive(Debug, Hash, Clone, Eq, PartialEq)]
 struct TestKey {
     id: u64,
diff --git a/ractor/src/factory/tests/dynamic_settings.rs b/ractor/src/factory/tests/dynamic_settings.rs
index 59b7fbe..306d848 100644
--- a/ractor/src/factory/tests/dynamic_settings.rs
+++ b/ractor/src/factory/tests/dynamic_settings.rs
@@ -5,14 +5,15 @@
 
 //! Tests around dynamic setting changes in factories
 
-use std::sync::{
-    atomic::{AtomicU8, Ordering},
-    Arc,
-};
+use std::sync::atomic::AtomicU8;
+use std::sync::atomic::Ordering;
+use std::sync::Arc;
 
 use crate::concurrency::sleep;
 use crate::factory::*;
-use crate::{Actor, ActorProcessingErr, ActorRef};
+use crate::Actor;
+use crate::ActorProcessingErr;
+use crate::ActorRef;
 
 struct TestWorker;
 
diff --git a/ractor/src/factory/tests/lifecycle.rs b/ractor/src/factory/tests/lifecycle.rs
index 616680b..283615a 100644
--- a/ractor/src/factory/tests/lifecycle.rs
+++ b/ractor/src/factory/tests/lifecycle.rs
@@ -10,17 +10,18 @@ use std::sync::atomic::Ordering;
 use std::sync::Arc;
 
 #[cfg(not(feature = "async-trait"))]
-use futures::{future::BoxFuture, FutureExt};
+use futures::future::BoxFuture;
+#[cfg(not(feature = "async-trait"))]
+use futures::FutureExt;
 
 use crate::concurrency::sleep;
 use crate::concurrency::Duration;
+use crate::factory::*;
+use crate::periodic_check;
 use crate::Actor;
 use crate::ActorProcessingErr;
 use crate::ActorRef;
 
-use crate::factory::*;
-use crate::periodic_check;
-
 #[derive(Clone)]
 struct AtomicHooks {
     state: Arc<AtomicU8>,
diff --git a/ractor/src/factory/tests/priority_queueing.rs b/ractor/src/factory/tests/priority_queueing.rs
index c1ae0b2..1591742 100644
--- a/ractor/src/factory/tests/priority_queueing.rs
+++ b/ractor/src/factory/tests/priority_queueing.rs
@@ -7,15 +7,15 @@ use std::sync::atomic::AtomicU16;
 use std::sync::atomic::Ordering;
 use std::sync::Arc;
 
-use crate::Actor;
-use crate::ActorProcessingErr;
-use crate::ActorRef;
 use tokio::sync::Notify;
 
 use crate::factory::queues::Priority;
 use crate::factory::queues::PriorityManager;
 use crate::factory::queues::StandardPriority;
 use crate::factory::*;
+use crate::Actor;
+use crate::ActorProcessingErr;
+use crate::ActorRef;
 
 type TestKey = StandardPriority;
 
diff --git a/ractor/src/factory/tests/ratelim.rs b/ractor/src/factory/tests/ratelim.rs
index b5070c8..559b1d3 100644
--- a/ractor/src/factory/tests/ratelim.rs
+++ b/ractor/src/factory/tests/ratelim.rs
@@ -9,7 +9,8 @@ use std::sync::atomic::AtomicU16;
 use std::sync::atomic::Ordering;
 use std::sync::Arc;
 
-use crate::concurrency::{sleep, Duration};
+use crate::concurrency::sleep;
+use crate::concurrency::Duration;
 use crate::factory::routing::*;
 use crate::factory::*;
 use crate::*;
diff --git a/ractor/src/factory/tests/worker_lifecycle.rs b/ractor/src/factory/tests/worker_lifecycle.rs
index 57bd7c7..2910515 100644
--- a/ractor/src/factory/tests/worker_lifecycle.rs
+++ b/ractor/src/factory/tests/worker_lifecycle.rs
@@ -12,12 +12,11 @@ use std::sync::Arc;
 use crate::concurrency::sleep;
 use crate::concurrency::Duration;
 use crate::concurrency::JoinHandle;
+use crate::factory::*;
 use crate::Actor;
 use crate::ActorProcessingErr;
 use crate::ActorRef;
 
-use crate::factory::*;
-
 struct MyWorker {
     counter: Arc<AtomicU16>,
 }
diff --git a/ractor/src/pg/tests.rs b/ractor/src/pg/tests.rs
index de3459f..bcdcaa2 100644
--- a/ractor/src/pg/tests.rs
+++ b/ractor/src/pg/tests.rs
@@ -3,17 +3,21 @@
 // This source code is licensed under both the MIT license found in the
 // LICENSE-MIT file in the root directory of this source tree.
 
-use std::sync::atomic::{AtomicU8, Ordering};
+use std::sync::atomic::AtomicU8;
+use std::sync::atomic::Ordering;
 use std::sync::Arc;
 
-use crate::common_test::periodic_check;
-use crate::concurrency::Duration;
 use ::function_name::named;
 use serial_test::serial;
 
-use crate::{Actor, ActorProcessingErr, GroupName, ScopeName, SupervisionEvent};
-
+use crate::common_test::periodic_check;
+use crate::concurrency::Duration;
 use crate::pg::{self};
+use crate::Actor;
+use crate::ActorProcessingErr;
+use crate::GroupName;
+use crate::ScopeName;
+use crate::SupervisionEvent;
 
 struct TestActor;
 
diff --git a/ractor/src/port/output/tests.rs b/ractor/src/port/output/tests.rs
index d59f26d..8ada8b5 100644
--- a/ractor/src/port/output/tests.rs
+++ b/ractor/src/port/output/tests.rs
@@ -7,12 +7,13 @@
 
 use std::time::Duration;
 
-use crate::{concurrency::timeout, ActorProcessingErr};
 use futures::future::join_all;
 
-use crate::{Actor, ActorRef};
-
 use super::*;
+use crate::concurrency::timeout;
+use crate::Actor;
+use crate::ActorProcessingErr;
+use crate::ActorRef;
 
 #[crate::concurrency::test]
 #[cfg_attr(
@@ -249,7 +250,11 @@ use output_port_subscriber_tests::*;
 
 mod output_port_subscriber_tests {
     use super::*;
-    use crate::{call_t, cast, Actor, ActorRef, RpcReplyPort};
+    use crate::call_t;
+    use crate::cast;
+    use crate::Actor;
+    use crate::ActorRef;
+    use crate::RpcReplyPort;
 
     enum NumberPublisherMessage {
         Publish(u8),
diff --git a/ractor/src/registry/tests.rs b/ractor/src/registry/tests.rs
index a1ee674..b947e31 100644
--- a/ractor/src/registry/tests.rs
+++ b/ractor/src/registry/tests.rs
@@ -6,8 +6,9 @@
 //! Tests on the actor registry
 
 use crate::concurrency::Duration;
-
-use crate::{Actor, ActorProcessingErr, SpawnErr};
+use crate::Actor;
+use crate::ActorProcessingErr;
+use crate::SpawnErr;
 
 #[crate::concurrency::test]
 #[cfg_attr(
@@ -149,10 +150,12 @@ mod pid_registry_tests {
     use dashmap::DashMap;
 
     use super::super::pid_registry::*;
-    use crate::{
-        common_test::periodic_check, concurrency::Duration, Actor, ActorId, ActorProcessingErr,
-        SupervisionEvent,
-    };
+    use crate::common_test::periodic_check;
+    use crate::concurrency::Duration;
+    use crate::Actor;
+    use crate::ActorId;
+    use crate::ActorProcessingErr;
+    use crate::SupervisionEvent;
 
     struct RemoteActor;
     struct RemoteActorMessage;
diff --git a/ractor/src/rpc/tests.rs b/ractor/src/rpc/tests.rs
index 3aff8dd..a11845c 100644
--- a/ractor/src/rpc/tests.rs
+++ b/ractor/src/rpc/tests.rs
@@ -5,15 +5,20 @@
 
 //! Tests for remote procedure calls
 
-use std::sync::atomic::{AtomicU8, Ordering};
+use std::sync::atomic::AtomicU8;
+use std::sync::atomic::Ordering;
 use std::sync::Arc;
 
+use crate::call;
+use crate::call_t;
+use crate::cast;
 use crate::common_test::periodic_check;
 use crate::concurrency::Duration;
-
-use crate::{call, call_t};
-use crate::{cast, forward, Actor, ActorRef};
-use crate::{rpc, ActorProcessingErr};
+use crate::forward;
+use crate::rpc;
+use crate::Actor;
+use crate::ActorProcessingErr;
+use crate::ActorRef;
 
 #[crate::concurrency::test]
 #[cfg_attr(
diff --git a/ractor/src/tests.rs b/ractor/src/tests.rs
index 801e785..db5766d 100644
--- a/ractor/src/tests.rs
+++ b/ractor/src/tests.rs
@@ -5,6 +5,11 @@
 
 //! Basic tests of errors, error conversions, etc
 
+#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
+use getrandom as _;
+// It was used by examples
+use ractor_example_entry_proc as _;
+
 use crate::concurrency::Duration;
 use crate::Actor;
 use crate::ActorCell;
@@ -12,12 +17,6 @@ use crate::ActorProcessingErr;
 use crate::ActorRef;
 use crate::RactorErr;
 
-// It was used by examples
-use ractor_example_entry_proc as _;
-
-#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
-use getrandom as _;
-
 #[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
 wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
 #[test]
diff --git a/ractor/src/thread_local/supervision_tests.rs b/ractor/src/thread_local/supervision_tests.rs
index daffa16..df0b37f 100644
--- a/ractor/src/thread_local/supervision_tests.rs
+++ b/ractor/src/thread_local/supervision_tests.rs
@@ -5,17 +5,19 @@
 
 //! Supervisor tests
 
-use std::sync::{
-    atomic::{AtomicU64, Ordering},
-    Arc,
-};
+use std::sync::atomic::AtomicU64;
+use std::sync::atomic::Ordering;
+use std::sync::Arc;
 
 use once_cell::sync::OnceCell;
 
+use crate::thread_local::ThreadLocalActor;
 use crate::thread_local::ThreadLocalActorSpawner;
-use crate::{thread_local::ThreadLocalActor, ActorProcessingErr};
-
-use crate::{Actor, ActorCell, ActorRef, SupervisionEvent};
+use crate::Actor;
+use crate::ActorCell;
+use crate::ActorProcessingErr;
+use crate::ActorRef;
+use crate::SupervisionEvent;
 
 static LOCAL_SPAWNER: OnceCell<ThreadLocalActorSpawner> = OnceCell::new();
 
diff --git a/ractor/src/thread_local/tests.rs b/ractor/src/thread_local/tests.rs
index 01e2bd4..2a65f02 100644
--- a/ractor/src/thread_local/tests.rs
+++ b/ractor/src/thread_local/tests.rs
@@ -5,24 +5,26 @@
 
 //! General tests, more logic-specific tests are contained in sub-modules
 
-use std::sync::{
-    atomic::{AtomicU32, AtomicU8, Ordering},
-    Arc,
-};
+use std::sync::atomic::AtomicU32;
+use std::sync::atomic::AtomicU8;
+use std::sync::atomic::Ordering;
+use std::sync::Arc;
 
 use once_cell::sync::OnceCell;
 
-use crate::{
-    actor::derived_actor::DerivedActorRef,
-    common_test::periodic_check,
-    concurrency::{sleep, Duration},
-    MessagingErr,
-};
-
-use crate::thread_local::ThreadLocalActor as Actor;
-use crate::{ActorCell, ActorProcessingErr, ActorRef, ActorStatus, SpawnErr, SupervisionEvent};
-
 use super::ThreadLocalActorSpawner;
+use crate::actor::derived_actor::DerivedActorRef;
+use crate::common_test::periodic_check;
+use crate::concurrency::sleep;
+use crate::concurrency::Duration;
+use crate::thread_local::ThreadLocalActor as Actor;
+use crate::ActorCell;
+use crate::ActorProcessingErr;
+use crate::ActorRef;
+use crate::ActorStatus;
+use crate::MessagingErr;
+use crate::SpawnErr;
+use crate::SupervisionEvent;
 
 static LOCAL_SPAWNER: OnceCell<ThreadLocalActorSpawner> = OnceCell::new();
 
diff --git a/ractor/src/time/tests.rs b/ractor/src/time/tests.rs
index b9d020b..0604c3d 100644
--- a/ractor/src/time/tests.rs
+++ b/ractor/src/time/tests.rs
@@ -5,14 +5,15 @@
 
 //! Tests of timers
 
-use std::sync::{
-    atomic::{AtomicU8, Ordering},
-    Arc,
-};
-
-use crate::{common_test::periodic_check, concurrency::Duration, ActorProcessingErr};
-
-use crate::{Actor, ActorRef};
+use std::sync::atomic::AtomicU8;
+use std::sync::atomic::Ordering;
+use std::sync::Arc;
+
+use crate::common_test::periodic_check;
+use crate::concurrency::Duration;
+use crate::Actor;
+use crate::ActorProcessingErr;
+use crate::ActorRef;
 
 #[crate::concurrency::test]
 #[cfg_attr(
diff --git a/ractor_cluster/src/node/node_session/tests.rs b/ractor_cluster/src/node/node_session/tests.rs
index 55df5bb..55d9045 100644
--- a/ractor_cluster/src/node/node_session/tests.rs
+++ b/ractor_cluster/src/node/node_session/tests.rs
@@ -5,19 +5,17 @@
 
 use std::collections::HashSet;
 use std::net::SocketAddr;
-use std::sync::{
-    atomic::{AtomicU8, Ordering},
-    Arc,
-};
+use std::sync::atomic::AtomicU8;
+use std::sync::atomic::Ordering;
+use std::sync::Arc;
 use std::time::Instant;
 
 use ractor::concurrency::sleep;
 
+use super::*;
 use crate::node::NodeConnectionMode;
 use crate::NodeSessionMessage;
 
-use super::*;
-
 struct DummyNodeServer;
 #[cfg_attr(feature = "async-trait", ractor::async_trait)]
 impl Actor for DummyNodeServer {
diff --git a/ractor_cluster_integration_tests/src/derive_macro_tests.rs b/ractor_cluster_integration_tests/src/derive_macro_tests.rs
index e948b0e..4fe9fe3 100644
--- a/ractor_cluster_integration_tests/src/derive_macro_tests.rs
+++ b/ractor_cluster_integration_tests/src/derive_macro_tests.rs
@@ -4,8 +4,10 @@
 // LICENSE-MIT file in the root directory of this source tree.
 
 use ractor::message::SerializedMessage;
-use ractor::{Message, RpcReplyPort};
-use ractor_cluster::{RactorClusterMessage, RactorMessage};
+use ractor::Message;
+use ractor::RpcReplyPort;
+use ractor_cluster::RactorClusterMessage;
+use ractor_cluster::RactorMessage;
 
 #[test]
 fn test_non_serializable_generation() {
diff --git a/ractor_cluster_integration_tests/src/main.rs b/ractor_cluster_integration_tests/src/main.rs
index 4a44531..d19fc55 100644
--- a/ractor_cluster_integration_tests/src/main.rs
+++ b/ractor_cluster_integration_tests/src/main.rs
@@ -8,7 +8,8 @@ use std::io::stderr;
 use std::io::IsTerminal;
 
 use clap::Parser;
-use rustyrepl::{Repl, ReplCommandProcessor};
+use rustyrepl::Repl;
+use rustyrepl::ReplCommandProcessor;
 use tracing_glog::Glog;
 use tracing_glog::GlogFields;
 use tracing_subscriber::filter::Directive;
diff --git a/ractor_cluster_integration_tests/src/ractor_forward_port_tests.rs b/ractor_cluster_integration_tests/src/ractor_forward_port_tests.rs
index aa7c6de..39f2a84 100644
--- a/ractor_cluster_integration_tests/src/ractor_forward_port_tests.rs
+++ b/ractor_cluster_integration_tests/src/ractor_forward_port_tests.rs
@@ -5,7 +5,8 @@
 
 use ractor::concurrency::Duration;
 use ractor::message::SerializedMessage;
-use ractor::{Message, RpcReplyPort};
+use ractor::Message;
+use ractor::RpcReplyPort;
 use ractor_cluster::RactorClusterMessage;
 
 #[derive(RactorClusterMessage)]
diff --git a/ractor_cluster_integration_tests/src/tests/auth_handshake.rs b/ractor_cluster_integration_tests/src/tests/auth_handshake.rs
index 924a58b..99dff26 100644
--- a/ractor_cluster_integration_tests/src/tests/auth_handshake.rs
+++ b/ractor_cluster_integration_tests/src/tests/auth_handshake.rs
@@ -7,8 +7,9 @@
 //! with the secret cookie challenge scheme
 
 use clap::Args;
-
-use ractor::concurrency::{sleep, Duration, Instant};
+use ractor::concurrency::sleep;
+use ractor::concurrency::Duration;
+use ractor::concurrency::Instant;
 use ractor::Actor;
 
 const AUTH_TIME_ALLOWANCE_MS: u128 = 1500;
diff --git a/ractor_cluster_integration_tests/src/tests/dist_connect.rs b/ractor_cluster_integration_tests/src/tests/dist_connect.rs
index e674318..4b77d2b 100644
--- a/ractor_cluster_integration_tests/src/tests/dist_connect.rs
+++ b/ractor_cluster_integration_tests/src/tests/dist_connect.rs
@@ -7,7 +7,9 @@
 //! then C should auto-connect to B
 
 use clap::Args;
-use ractor::concurrency::{sleep, Duration, Instant};
+use ractor::concurrency::sleep;
+use ractor::concurrency::Duration;
+use ractor::concurrency::Instant;
 use ractor::Actor;
 
 const DIST_CONNECT_TIME_ALLOWANCE_MS: u128 = 2000;
diff --git a/ractor_cluster_integration_tests/src/tests/encryption.rs b/ractor_cluster_integration_tests/src/tests/encryption.rs
index 24ec3e4..1ec532a 100644
--- a/ractor_cluster_integration_tests/src/tests/encryption.rs
+++ b/ractor_cluster_integration_tests/src/tests/encryption.rs
@@ -14,11 +14,18 @@ use std::path::PathBuf;
 use std::sync::Arc;
 
 use clap::Args;
-use ractor::concurrency::{sleep, Duration, Instant};
-use ractor::{Actor, ActorProcessingErr};
+use ractor::concurrency::sleep;
+use ractor::concurrency::Duration;
+use ractor::concurrency::Instant;
+use ractor::Actor;
+use ractor::ActorProcessingErr;
 use tokio_rustls::rustls::pki_types::pem::PemObject;
-use tokio_rustls::rustls::pki_types::{CertificateDer, PrivateKeyDer, ServerName, TrustAnchor};
-use tokio_rustls::{TlsAcceptor, TlsConnector};
+use tokio_rustls::rustls::pki_types::CertificateDer;
+use tokio_rustls::rustls::pki_types::PrivateKeyDer;
+use tokio_rustls::rustls::pki_types::ServerName;
+use tokio_rustls::rustls::pki_types::TrustAnchor;
+use tokio_rustls::TlsAcceptor;
+use tokio_rustls::TlsConnector;
 
 const AUTH_TIME_ALLOWANCE_MS: u128 = 1500;
 
diff --git a/ractor_cluster_integration_tests/src/tests/mod.rs b/ractor_cluster_integration_tests/src/tests/mod.rs
index 4daeac3..e2e6a1a 100644
--- a/ractor_cluster_integration_tests/src/tests/mod.rs
+++ b/ractor_cluster_integration_tests/src/tests/mod.rs
@@ -7,7 +7,8 @@
 
 use clap::Parser;
 use rand::distributions::Alphanumeric;
-use rand::{thread_rng, Rng};
+use rand::thread_rng;
+use rand::Rng;
 
 pub mod auth_handshake;
 pub mod dist_connect;
diff --git a/ractor_cluster_integration_tests/src/tests/pg_groups.rs b/ractor_cluster_integration_tests/src/tests/pg_groups.rs
index 5218d47..60fb456 100644
--- a/ractor_cluster_integration_tests/src/tests/pg_groups.rs
+++ b/ractor_cluster_integration_tests/src/tests/pg_groups.rs
@@ -16,8 +16,13 @@
 //! it then does a teardown
 
 use clap::Args;
-use ractor::concurrency::{sleep, Duration, Instant};
-use ractor::{Actor, ActorProcessingErr, ActorRef, RpcReplyPort};
+use ractor::concurrency::sleep;
+use ractor::concurrency::Duration;
+use ractor::concurrency::Instant;
+use ractor::Actor;
+use ractor::ActorProcessingErr;
+use ractor::ActorRef;
+use ractor::RpcReplyPort;
 use ractor_cluster::RactorClusterMessage;
 
 const NUM_HELLOS: u16 = 10;