mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Clippy perf warnings
This commit is contained in:
parent
9e437b2642
commit
4b7f473223
3 changed files with 3 additions and 4 deletions
|
@ -260,7 +260,7 @@ impl<'a> TtIter<'a> {
|
||||||
| ('|', '=', None)
|
| ('|', '=', None)
|
||||||
| ('|', '|', None) => {
|
| ('|', '|', None) => {
|
||||||
let tt2 = self.next().unwrap().clone();
|
let tt2 = self.next().unwrap().clone();
|
||||||
Ok(tt::Subtree { delimiter: None, token_trees: vec![tt.clone(), tt2] }.into())
|
Ok(tt::Subtree { delimiter: None, token_trees: vec![tt, tt2] }.into())
|
||||||
}
|
}
|
||||||
_ => Ok(tt),
|
_ => Ok(tt),
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ fn find_registrar_symbol(file: &Path) -> io::Result<Option<String>> {
|
||||||
// https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dlsym.3.html
|
// https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dlsym.3.html
|
||||||
// Unlike other dyld API's, the symbol name passed to dlsym() must NOT be
|
// Unlike other dyld API's, the symbol name passed to dlsym() must NOT be
|
||||||
// prepended with an underscore.
|
// prepended with an underscore.
|
||||||
if s.name.starts_with("_") {
|
if s.name.starts_with('_') {
|
||||||
&s.name[1..]
|
&s.name[1..]
|
||||||
} else {
|
} else {
|
||||||
&s.name
|
&s.name
|
||||||
|
|
|
@ -204,8 +204,7 @@ impl GlobalState {
|
||||||
if let Some((method, start)) = self.req_queue.incoming.complete(response.id.clone()) {
|
if let Some((method, start)) = self.req_queue.incoming.complete(response.id.clone()) {
|
||||||
let duration = start.elapsed();
|
let duration = start.elapsed();
|
||||||
log::info!("handled req#{} in {:?}", response.id, duration);
|
log::info!("handled req#{} in {:?}", response.id, duration);
|
||||||
let metrics =
|
let metrics = RequestMetrics { id: response.id.clone(), method, duration };
|
||||||
RequestMetrics { id: response.id.clone(), method: method.to_string(), duration };
|
|
||||||
self.latest_requests.write().record(metrics);
|
self.latest_requests.write().record(metrics);
|
||||||
self.send(response.into());
|
self.send(response.into());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue