Skip to content

Commit 95c3bac

Browse files
authored
Make enum print::PrintFmt non-exhaustive (#651)
Per workingjubilee's [comment](#649 (comment))
1 parent 59cf05f commit 95c3bac

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/print.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ pub struct BacktraceFmt<'a, 'b> {
2424

2525
/// The styles of printing that we can print
2626
#[derive(Copy, Clone, Eq, PartialEq)]
27+
#[non_exhaustive]
2728
pub enum PrintFmt {
2829
/// Prints a terser backtrace which ideally only contains relevant information
2930
Short,
3031
/// Prints a backtrace that contains all possible information
3132
Full,
32-
#[doc(hidden)]
33-
__Nonexhaustive,
3433
}
3534

3635
impl<'a, 'b> BacktraceFmt<'a, 'b> {
@@ -254,7 +253,7 @@ impl BacktraceFrameFmt<'_, '_, '_> {
254253
match (symbol_name, &self.fmt.format) {
255254
(Some(name), PrintFmt::Short) => write!(self.fmt.fmt, "{name:#}")?,
256255
(Some(name), PrintFmt::Full) => write!(self.fmt.fmt, "{name}")?,
257-
(None, _) | (_, PrintFmt::__Nonexhaustive) => write!(self.fmt.fmt, "<unknown>")?,
256+
(None, _) => write!(self.fmt.fmt, "<unknown>")?,
258257
}
259258
self.fmt.fmt.write_str("\n")?;
260259

0 commit comments

Comments
 (0)