diff --git a/cmd/counters/src/lib.rs b/cmd/counters/src/lib.rs index 552d48252..5abe5ee2b 100644 --- a/cmd/counters/src/lib.rs +++ b/cmd/counters/src/lib.rs @@ -166,12 +166,10 @@ fn counters(context: &mut ExecutionContext) -> Result<()> { while let Some(((varname, var), def)) = ctrs.next() { if let Some(def) = def { println!(" +---> {varname}:"); - let pad = if ctrs.peek().is_some() { - " | " - } else { - " " - }; - if let Err(e) = counter_dump(hubris, core, def, var, subargs.full, pad) { + let pad = if ctrs.peek().is_some() { " | " } else { " " }; + if let Err(e) = + counter_dump(hubris, core, def, var, subargs.full, pad) + { if subargs.verbose { humility::msg!("counter dump failed: {e:?}"); } else { @@ -182,7 +180,6 @@ fn counters(context: &mut ExecutionContext) -> Result<()> { humility::msg!("could not look up type: {:?}", var.goff); } } - } Ok(()) } diff --git a/cmd/ringbuf/src/lib.rs b/cmd/ringbuf/src/lib.rs index f202455cc..6646617fd 100644 --- a/cmd/ringbuf/src/lib.rs +++ b/cmd/ringbuf/src/lib.rs @@ -133,7 +133,7 @@ fn ringbuf_dump( let ringbuf = Ringbuf::from_value(&cell.cell.value)?; Ok::<_, anyhow::Error>((Some(ringbuf), None)) })?; - + if let (Some(counters), false) = (counters, no_totals) { const TOTAL_WIDTH: usize = 8; if full_totals { diff --git a/humility-doppel/src/lib.rs b/humility-doppel/src/lib.rs index a2edbcd7c..b13d69f8f 100644 --- a/humility-doppel/src/lib.rs +++ b/humility-doppel/src/lib.rs @@ -399,8 +399,14 @@ impl Counters { self.counts.values().map(CounterVariant::total).sum() } - pub fn display_padded<'a>(&'a self, pad: &'a str) -> impl fmt::Display + 'a { - struct PaddedCtrs<'a> {ctrs: &'a Counters, pad: &'a str } + pub fn display_padded<'a>( + &'a self, + pad: &'a str, + ) -> impl fmt::Display + 'a { + struct PaddedCtrs<'a> { + ctrs: &'a Counters, + pad: &'a str, + } impl fmt::Display for PaddedCtrs<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.ctrs.fmt_padded(self.pad, f) @@ -416,7 +422,7 @@ impl Counters { prefix: &str, Counters { ref counts }: &Counters, indent: usize, - f: &mut fmt::Formatter<'_> + f: &mut fmt::Formatter<'_>, ) -> fmt::Result { let total_len = f.width().unwrap_or(8); let (before, after) = @@ -476,7 +482,6 @@ impl Counters { } } - impl humility::reflect::Load for CounterVariant { fn from_value(value: &Value) -> Result { let counter = value.as_struct()?;