Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make enum print::PrintFmt non-exhaustive #651

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down Expand Up @@ -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, "<unknown>")?,
(None, _) => write!(self.fmt.fmt, "<unknown>")?,
}
self.fmt.fmt.write_str("\n")?;

Expand Down
Loading