aboutsummaryrefslogtreecommitdiff
path: root/crates/profile/src/hprof.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-11-02 12:13:32 +0000
committerAleksey Kladov <[email protected]>2020-11-02 13:07:08 +0000
commitb6101184537b1165cfdd5fc473e04ad4c5b7bffa (patch)
treebcc2efd8a2696840a4724ad88758e973ecb77157 /crates/profile/src/hprof.rs
parente7f90866bcf4b04a11e958eda0ac53f7ff0a607b (diff)
Deny unreachable-pub
It's very useful when `pub` is equivalent to "this is crate's public API", let's enforce this! Ideally, we should enforce it for local `cargo test`, and only during CI, but that needs https://github.com/rust-lang/cargo/issues/5034.
Diffstat (limited to 'crates/profile/src/hprof.rs')
-rw-r--r--crates/profile/src/hprof.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/profile/src/hprof.rs b/crates/profile/src/hprof.rs
index 934cc8e37..8957ea016 100644
--- a/crates/profile/src/hprof.rs
+++ b/crates/profile/src/hprof.rs
@@ -27,7 +27,7 @@ pub fn init_from(spec: &str) {
27 filter.install(); 27 filter.install();
28} 28}
29 29
30pub type Label = &'static str; 30type Label = &'static str;
31 31
32/// This function starts a profiling scope in the current execution stack with a given description. 32/// This function starts a profiling scope in the current execution stack with a given description.
33/// It returns a `Profile` struct that measures elapsed time between this method invocation and `Profile` struct drop. 33/// It returns a `Profile` struct that measures elapsed time between this method invocation and `Profile` struct drop.
@@ -173,7 +173,7 @@ impl ProfileStack {
173 true 173 true
174 } 174 }
175 175
176 pub fn pop(&mut self, label: Label, detail: Option<String>) { 176 fn pop(&mut self, label: Label, detail: Option<String>) {
177 let start = self.starts.pop().unwrap(); 177 let start = self.starts.pop().unwrap();
178 let duration = start.elapsed(); 178 let duration = start.elapsed();
179 self.messages.finish(Message { duration, label, detail }); 179 self.messages.finish(Message { duration, label, detail });