Skip to content

Commit

Permalink
Have pretty and show_backtrace accept booleans
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchen1991 committed Oct 22, 2021
1 parent 59df6c8 commit 6a59d0e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions library/std/src/error.rs
Expand Up @@ -850,7 +850,7 @@ impl dyn Error + Send + Sync {
///
/// fn main() {
/// let error = SuperError { side: SuperErrorSideKick };
/// let report = Report::new(&error).pretty();
/// let report = Report::new(&error).pretty(true);
///
/// println!("{}", report);
/// }
Expand All @@ -874,15 +874,15 @@ where

/// Enable pretty-printing the report.
#[unstable(feature = "error_reporter", issue = "90172")]
pub fn pretty(mut self) -> Self {
self.pretty = true;
pub fn pretty(mut self, pretty: bool) -> Self {
self.pretty = pretty;
self
}

/// Enable showing a backtrace for the report.
#[unstable(feature = "error_reporter", issue = "90172")]
pub fn show_backtrace(mut self) -> Self {
self.show_backtrace = true;
pub fn show_backtrace(mut self, show_backtrace: bool) -> Self {
self.show_backtrace = show_backtrace;
self
}

Expand Down

0 comments on commit 6a59d0e

Please sign in to comment.