aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2019-04-26 16:41:58 +0100
committerkjeremy <[email protected]>2019-04-26 16:41:58 +0100
commit47f10fce8ada7638e3298e3e12f794b4859af754 (patch)
treeb564b04b6203ba1fb2981773b497c50958ee591c
parent70dc33e00c305e83bd2dc1de17c09af5c0faef7f (diff)
Pass in char instead of single-char string
-rw-r--r--crates/ra_prof/src/lib.rs6
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