aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_prof/src/lib.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-11 02:05:15 +0100
committerGitHub <[email protected]>2020-07-11 02:05:15 +0100
commita3edd482e9fc6b970df8cd024addd94b29f3f4e9 (patch)
treefceb4cb7e0f5981f6655b9823e67526805b438ae /crates/ra_prof/src/lib.rs
parent539659cde36af73eb7a3a0795bb71b0d66f7d7cd (diff)
parente7ba7f47a79a2881cf208ef9d944609e8fd4eec9 (diff)
Merge #5305
5305: Profiling tweaks r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_prof/src/lib.rs')
-rw-r--r--crates/ra_prof/src/lib.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs
index 89df7f04b..0fb468375 100644
--- a/crates/ra_prof/src/lib.rs
+++ b/crates/ra_prof/src/lib.rs
@@ -43,6 +43,7 @@ pub struct Scope {
43} 43}
44 44
45impl Scope { 45impl Scope {
46 #[must_use]
46 pub fn enter() -> Scope { 47 pub fn enter() -> Scope {
47 let prev = IN_SCOPE.with(|slot| std::mem::replace(&mut *slot.borrow_mut(), true)); 48 let prev = IN_SCOPE.with(|slot| std::mem::replace(&mut *slot.borrow_mut(), true));
48 Scope { prev } 49 Scope { prev }
@@ -78,6 +79,7 @@ pub struct CpuProfiler {
78 _private: (), 79 _private: (),
79} 80}
80 81
82#[must_use]
81pub fn cpu_profiler() -> CpuProfiler { 83pub fn cpu_profiler() -> CpuProfiler {
82 #[cfg(feature = "cpu_profiler")] 84 #[cfg(feature = "cpu_profiler")]
83 { 85 {