From a99c4f8487b89baf563521082d375aafcbaa8299 Mon Sep 17 00:00:00 2001 From: MattJackson <1085847+MattJackson@users.noreply.github.com> Date: Tue, 12 May 2026 09:18:52 -0700 Subject: [PATCH] v0.18.21: format code --- src/io/mod.rs | 5 ++- src/io/pipeline.rs | 82 +++++++++++++++++++++------------------------- src/lib.rs | 24 +++++++------- 3 files changed, 54 insertions(+), 57 deletions(-) diff --git a/src/io/mod.rs b/src/io/mod.rs index 4d8f50d..4e3ec72 100644 --- a/src/io/mod.rs +++ b/src/io/mod.rs @@ -27,4 +27,7 @@ pub(crate) use writeback_file::WritebackFile; // caller — the targeted `#[allow]` keeps the re-export visible without // dragging the rest of the module under `dead_code`. #[allow(unused_imports)] -pub use pipeline::{DEFAULT_PIPELINE_DEPTH, Flow, Pipeline, READ_PIPELINE_DEPTH, Sink, WRITE_PIPELINE_DEPTH, WRITE_THROUGH_DEPTH}; +pub use pipeline::{ + DEFAULT_PIPELINE_DEPTH, Flow, Pipeline, READ_PIPELINE_DEPTH, Sink, WRITE_PIPELINE_DEPTH, + WRITE_THROUGH_DEPTH, +}; diff --git a/src/io/pipeline.rs b/src/io/pipeline.rs index 781627d..00b449c 100644 --- a/src/io/pipeline.rs +++ b/src/io/pipeline.rs @@ -153,57 +153,51 @@ impl Pipeline { let mut first_err: Option = None; let mut stopped = false; - while let Ok(item) = rx.recv() { - if debug_enabled() { - tracing::debug!( - "Pipeline receive: item={}", - std::any::type_name::() - ); - } + while let Ok(item) = rx.recv() { + if debug_enabled() { + tracing::debug!("Pipeline receive: item={}", std::any::type_name::()); + } - let apply_start = std::time::Instant::now(); + let apply_start = std::time::Instant::now(); - if first_err.is_some() || stopped { - // Drain remaining items so the producer never - // blocks on a dead receiver. `apply` is not - // called once we've decided to stop. - continue; - } - match sink.apply(item) { - Ok(Flow::Continue) => {} - Ok(Flow::Stop) => { - stopped = true; - if debug_enabled() { - tracing::debug!("Pipeline: consumer returned Flow::Stop"); - } - } - Err(e) => { - if debug_enabled() { - tracing::debug!( - "Pipeline: apply error, stopping, err={:?}", - e - ); - } - first_err = Some(e); + if first_err.is_some() || stopped { + // Drain remaining items so the producer never + // blocks on a dead receiver. `apply` is not + // called once we've decided to stop. + continue; + } + match sink.apply(item) { + Ok(Flow::Continue) => {} + Ok(Flow::Stop) => { + stopped = true; + if debug_enabled() { + tracing::debug!("Pipeline: consumer returned Flow::Stop"); } } - - let apply_elapsed = apply_start.elapsed(); - if debug_enabled() && apply_elapsed > std::time::Duration::from_millis(100) { - tracing::debug!( - "Pipeline apply: took {:.2}s, item={}", - apply_elapsed.as_secs_f64(), - std::any::type_name::() - ); - } else if debug_enabled() { - tracing::debug!( - "Pipeline apply: OK in {:.3}ms, item={}", - apply_elapsed.as_micros(), - std::any::type_name::() - ); + Err(e) => { + if debug_enabled() { + tracing::debug!("Pipeline: apply error, stopping, err={:?}", e); + } + first_err = Some(e); } } + let apply_elapsed = apply_start.elapsed(); + if debug_enabled() && apply_elapsed > std::time::Duration::from_millis(100) { + tracing::debug!( + "Pipeline apply: took {:.2}s, item={}", + apply_elapsed.as_secs_f64(), + std::any::type_name::() + ); + } else if debug_enabled() { + tracing::debug!( + "Pipeline apply: OK in {:.3}ms, item={}", + apply_elapsed.as_micros(), + std::any::type_name::() + ); + } + } + match first_err { Some(e) => Err(e), None => sink.close(), diff --git a/src/lib.rs b/src/lib.rs index 8ae974a..7e1434d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,18 +72,18 @@ //! | E7xxx | AACS errors | pub mod aacs; - pub(crate) mod clpi; - pub mod css; - pub mod decrypt; - pub mod disc; - pub mod drive; - pub mod error; - pub mod event; - pub mod halt; - pub(crate) mod identity; - pub(crate) mod ifo; - pub mod io; - pub mod keydb; +pub(crate) mod clpi; +pub mod css; +pub mod decrypt; +pub mod disc; +pub mod drive; +pub mod error; +pub mod event; +pub mod halt; +pub(crate) mod identity; +pub(crate) mod ifo; +pub mod io; +pub mod keydb; pub mod labels; pub(crate) mod mpls; pub mod mux;