diff options
| author | bors <bors@rust-lang.org> | 2023-02-18 19:38:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-02-18 19:38:24 +0000 |
| commit | 6c7f09b77da1f8b78b8a035682ee971439b84fa6 (patch) | |
| tree | f69278760a89acf06afe01e551473fd080b4e406 /compiler/rustc_data_structures/src | |
| parent | 73f83ffc0f1a2349d9b980e0168c8b606c2fb152 (diff) | |
| parent | b76b26ee1aff1cb1bf4ea5c66da3b938ddd3bdcc (diff) | |
| download | rust-6c7f09b77da1f8b78b8a035682ee971439b84fa6.tar.gz rust-6c7f09b77da1f8b78b8a035682ee971439b84fa6.zip | |
Auto merge of #2792 - RalfJung:rustup, r=RalfJung
Rustup
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/profiling.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/rustc_data_structures/src/profiling.rs b/compiler/rustc_data_structures/src/profiling.rs index 3aca03f6e5c..44331683694 100644 --- a/compiler/rustc_data_structures/src/profiling.rs +++ b/compiler/rustc_data_structures/src/profiling.rs @@ -207,8 +207,7 @@ impl SelfProfilerRef { /// a measureme event, "verbose" generic activities also print a timing entry to /// stderr if the compiler is invoked with -Ztime-passes. pub fn verbose_generic_activity(&self, event_label: &'static str) -> VerboseTimingGuard<'_> { - let message = - if self.print_verbose_generic_activities { Some(event_label.to_owned()) } else { None }; + let message = self.print_verbose_generic_activities.then(|| event_label.to_owned()); VerboseTimingGuard::start(message, self.generic_activity(event_label)) } @@ -222,11 +221,9 @@ impl SelfProfilerRef { where A: Borrow<str> + Into<String>, { - let message = if self.print_verbose_generic_activities { - Some(format!("{}({})", event_label, event_arg.borrow())) - } else { - None - }; + let message = self + .print_verbose_generic_activities + .then(|| format!("{}({})", event_label, event_arg.borrow())); VerboseTimingGuard::start(message, self.generic_activity_with_arg(event_label, event_arg)) } |
