From 2230611c8a7cbd5cf3efab33a0c9292afc708b79 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Sat, 3 Aug 2024 01:14:58 -0400 Subject: [PATCH] Make enum `print::PrintFmt` non-exhaustive --- src/print.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/print.rs b/src/print.rs index 6e38a0f1..c9c8c453 100644 --- a/src/print.rs +++ b/src/print.rs @@ -24,13 +24,12 @@ pub struct BacktraceFmt<'a, 'b> { /// The styles of printing that we can print #[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] pub enum PrintFmt { /// Prints a terser backtrace which ideally only contains relevant information Short, /// Prints a backtrace that contains all possible information Full, - #[doc(hidden)] - __Nonexhaustive, } impl<'a, 'b> BacktraceFmt<'a, 'b> { @@ -254,7 +253,7 @@ impl BacktraceFrameFmt<'_, '_, '_> { match (symbol_name, &self.fmt.format) { (Some(name), PrintFmt::Short) => write!(self.fmt.fmt, "{name:#}")?, (Some(name), PrintFmt::Full) => write!(self.fmt.fmt, "{name}")?, - (None, _) | (_, PrintFmt::__Nonexhaustive) => write!(self.fmt.fmt, "")?, + (None, _) => write!(self.fmt.fmt, "")?, } self.fmt.fmt.write_str("\n")?;