aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-08 14:55:56 +0100
committerGitHub <[email protected]>2020-07-08 14:55:56 +0100
commita622a8e109e0f41f1b7cf869acb955eab8c95b43 (patch)
tree048930ccb8537398aa46bfb7aa6a2445516c2fdd /crates
parent9e437b26425e1c4691e2d1c5555ade5c109a358a (diff)
parent4b7f473223a939b702b89b6ef4db59bdbfff32d4 (diff)
Merge #5263
5263: Fix some clippy perf warnings r=matklad a=kjeremy Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_mbe/src/mbe_expander/matcher.rs2
-rw-r--r--crates/ra_proc_macro_srv/src/dylib.rs2
-rw-r--r--crates/rust-analyzer/src/global_state.rs3
3 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_mbe/src/mbe_expander/matcher.rs b/crates/ra_mbe/src/mbe_expander/matcher.rs
index 78f9efa1b..f9e515b81 100644
--- a/crates/ra_mbe/src/mbe_expander/matcher.rs
+++ b/crates/ra_mbe/src/mbe_expander/matcher.rs
@@ -260,7 +260,7 @@ impl<'a> TtIter<'a> {
260 | ('|', '=', None) 260 | ('|', '=', None)
261 | ('|', '|', None) => { 261 | ('|', '|', None) => {
262 let tt2 = self.next().unwrap().clone(); 262 let tt2 = self.next().unwrap().clone();
263 Ok(tt::Subtree { delimiter: None, token_trees: vec![tt.clone(), tt2] }.into()) 263 Ok(tt::Subtree { delimiter: None, token_trees: vec![tt, tt2] }.into())
264 } 264 }
265 _ => Ok(tt), 265 _ => Ok(tt),
266 } 266 }
diff --git a/crates/ra_proc_macro_srv/src/dylib.rs b/crates/ra_proc_macro_srv/src/dylib.rs
index aa84e951c..1addbbd54 100644
--- a/crates/ra_proc_macro_srv/src/dylib.rs
+++ b/crates/ra_proc_macro_srv/src/dylib.rs
@@ -45,7 +45,7 @@ fn find_registrar_symbol(file: &Path) -> io::Result<Option<String>> {
45 // https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dlsym.3.html 45 // https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dlsym.3.html
46 // Unlike other dyld API's, the symbol name passed to dlsym() must NOT be 46 // Unlike other dyld API's, the symbol name passed to dlsym() must NOT be
47 // prepended with an underscore. 47 // prepended with an underscore.
48 if s.name.starts_with("_") { 48 if s.name.starts_with('_') {
49 &s.name[1..] 49 &s.name[1..]
50 } else { 50 } else {
51 &s.name 51 &s.name
diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs
index 640b3959d..c8d34e15a 100644
--- a/crates/rust-analyzer/src/global_state.rs
+++ b/crates/rust-analyzer/src/global_state.rs
@@ -204,8 +204,7 @@ impl GlobalState {
204 if let Some((method, start)) = self.req_queue.incoming.complete(response.id.clone()) { 204 if let Some((method, start)) = self.req_queue.incoming.complete(response.id.clone()) {
205 let duration = start.elapsed(); 205 let duration = start.elapsed();
206 log::info!("handled req#{} in {:?}", response.id, duration); 206 log::info!("handled req#{} in {:?}", response.id, duration);
207 let metrics = 207 let metrics = RequestMetrics { id: response.id.clone(), method, duration };
208 RequestMetrics { id: response.id.clone(), method: method.to_string(), duration };
209 self.latest_requests.write().record(metrics); 208 self.latest_requests.write().record(metrics);
210 self.send(response.into()); 209 self.send(response.into());
211 } 210 }