Skip to content

Commit

Permalink
Run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
AljoschaMeyer committed Jul 21, 2024
1 parent 6d5e701 commit efcfc3d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ pub mod errors;
pub mod producer;

#[cfg(all(feature = "dev", feature = "alloc"))]
pub(crate) mod test_yielder;
pub(crate) mod test_yielder;
2 changes: 1 addition & 1 deletion src/common/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ pub use scramble::{ConsumeOperations, Scramble_ as Scramble};
#[cfg(all(feature = "dev", feature = "alloc"))]
mod test_consumer;
#[cfg(all(feature = "dev", feature = "alloc"))]
pub use test_consumer::{TestConsumer_ as TestConsumer, TestConsumerBuilder};
pub use test_consumer::{TestConsumerBuilder, TestConsumer_ as TestConsumer};
8 changes: 4 additions & 4 deletions src/common/consumer/test_consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ impl<Item, Final, Error> TestConsumer<Item, Final, Error> {

fn check_error(&mut self) -> Result<(), Error> {
if self.operations_until_error == 0 {
Err(self.error.take().unwrap())// Can unwrap because the invariant wrapper panics before unwrapping can be reached.
Err(self.error.take().unwrap()) // Can unwrap because the invariant wrapper panics before unwrapping can be reached.
} else {
self.operations_until_error -= 1;
Ok(())
Expand Down Expand Up @@ -338,7 +338,7 @@ impl<Item, Final, Error> Consumer for TestConsumer<Item, Final, Error> {
{
Consumer::consume(&mut self.inner, item).unwrap();
Ok(())
}// may unwrap because Err<!>
} // may unwrap because Err<!>
}

fn close(&mut self, fin: Self::Final) -> Result<(), Self::Error> {
Expand All @@ -348,7 +348,7 @@ impl<Item, Final, Error> Consumer for TestConsumer<Item, Final, Error> {
{
Consumer::close(&mut self.inner, ()).unwrap();
Ok(())
}// may unwrap because Err<!>
} // may unwrap because Err<!>
}
}

Expand All @@ -359,7 +359,7 @@ impl<Item, Final, Error> BufferedConsumer for TestConsumer<Item, Final, Error> {
{
BufferedConsumer::flush(&mut self.inner).unwrap();
Ok(())
}// may unwrap because Err<!>
} // may unwrap because Err<!>
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/local_nb/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! The [SyncToLocalNb] adaptor allows you to use a [`sync::Consumer`](crate::sync::Consumer) as a [`local_nb::Consumer`](crate::local_nb::Consumer).
//!
//! ## Development Helpers
//!
//!
//! Use the [TestConsumer] for testing code that interacts with arbitrary consumers.
//!
//! The [Invariant] adaptor wraps any consumer and makes it panic during tests when some client code violates the API contracts imposed by the consumer traits. In production builds, the wrapper does nothing and compiles away without any overhead. We recommend using this wrapper as an implementation detail of all custom consumers; all consumers in the ufotofu crate use this wrapper internally as well.
Expand All @@ -31,4 +31,4 @@ pub use crate::common::consumer::{IntoVec, IntoVecFallible};
pub use crate::common::consumer::{ConsumeOperations, Scramble};

#[cfg(all(feature = "dev", feature = "alloc"))]
pub use crate::common::consumer::{TestConsumer, TestConsumerBuilder};
pub use crate::common::consumer::{TestConsumer, TestConsumerBuilder};
2 changes: 1 addition & 1 deletion src/sync/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! The [IntoVec] consumer consumes items into a `Vec` that grows to fit an arbitrary number of items. The [IntoVecFallible] consumer does the same, but reports memory allocation errors instead of panicking.
//!
//! ## Development Helpers
//!
//!
//! Use the [TestConsumer] for testing code that interacts with arbitrary consumers.
//!
//! The [Invariant] adaptor wraps any consumer and makes it panic during tests when some client code violates the API contracts imposed by the consumer traits. In production builds, the wrapper does nothing and compiles away without any overhead. We recommend using this wrapper as an implementation detail of all custom consumers; all consumers in the ufotofu crate use this wrapper internally as well.
Expand Down

0 comments on commit efcfc3d

Please sign in to comment.