diff options
| author | Sean Chen <seanchen11235@gmail.com> | 2021-10-22 13:43:42 -0500 |
|---|---|---|
| committer | Sean Chen <seanchen11235@gmail.com> | 2021-10-22 13:43:42 -0500 |
| commit | 6a59d0e3aa26543fc4d3eaae1fa4cd48522045d2 (patch) | |
| tree | d5e5ce516966eabf331739e621c8e2e84196f4b8 /library/std/src | |
| parent | 59df6c8eb917cba41c15e3366f29ee780c9c74df (diff) | |
| download | rust-6a59d0e3aa26543fc4d3eaae1fa4cd48522045d2.tar.gz rust-6a59d0e3aa26543fc4d3eaae1fa4cd48522045d2.zip | |
Have `pretty` and `show_backtrace` accept booleans
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/error.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/std/src/error.rs b/library/std/src/error.rs index 9fb8f2b9b8b..5988075836d 100644 --- a/library/std/src/error.rs +++ b/library/std/src/error.rs @@ -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); /// } @@ -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 } |
