diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_prof/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs index 402c719b1..ba432912f 100644 --- a/crates/ra_prof/src/lib.rs +++ b/crates/ra_prof/src/lib.rs | |||
@@ -107,7 +107,7 @@ impl Filter { | |||
107 | // env RA_PROFILE=foo|bar|baz // enabled only selected entries | 107 | // env RA_PROFILE=foo|bar|baz // enabled only selected entries |
108 | // env RA_PROFILE=*@3>10 // dump everything, up to depth 3, if it takes more than 10 ms | 108 | // env RA_PROFILE=*@3>10 // dump everything, up to depth 3, if it takes more than 10 ms |
109 | pub fn from_spec(mut spec: &str) -> Filter { | 109 | pub fn from_spec(mut spec: &str) -> Filter { |
110 | let longer_than = if let Some(idx) = spec.rfind(">") { | 110 | let longer_than = if let Some(idx) = spec.rfind('>') { |
111 | let longer_than = spec[idx + 1..].parse().expect("invalid profile longer_than"); | 111 | let longer_than = spec[idx + 1..].parse().expect("invalid profile longer_than"); |
112 | spec = &spec[..idx]; | 112 | spec = &spec[..idx]; |
113 | Duration::from_millis(longer_than) | 113 | Duration::from_millis(longer_than) |
@@ -115,7 +115,7 @@ impl Filter { | |||
115 | Duration::new(0, 0) | 115 | Duration::new(0, 0) |
116 | }; | 116 | }; |
117 | 117 | ||
118 | let depth = if let Some(idx) = spec.rfind("@") { | 118 | let depth = if let Some(idx) = spec.rfind('@') { |
119 | let depth: usize = spec[idx + 1..].parse().expect("invalid profile depth"); | 119 | let depth: usize = spec[idx + 1..].parse().expect("invalid profile depth"); |
120 | spec = &spec[..idx]; | 120 | spec = &spec[..idx]; |
121 | depth | 121 | depth |
@@ -123,7 +123,7 @@ impl Filter { | |||
123 | 999 | 123 | 999 |
124 | }; | 124 | }; |
125 | let allowed = | 125 | let allowed = |
126 | if spec == "*" { Vec::new() } else { spec.split("|").map(String::from).collect() }; | 126 | if spec == "*" { Vec::new() } else { spec.split('|').map(String::from).collect() }; |
127 | Filter::new(depth, allowed, longer_than) | 127 | Filter::new(depth, allowed, longer_than) |
128 | } | 128 | } |
129 | 129 | ||