mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +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) => {
|
||||
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),
|
||||
}
|
||||
|
|
|
@ -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
|
||||
// Unlike other dyld API's, the symbol name passed to dlsym() must NOT be
|
||||
// prepended with an underscore.
|
||||
if s.name.starts_with("_") {
|
||||
if s.name.starts_with('_') {
|
||||
&s.name[1..]
|
||||
} else {
|
||||
&s.name
|
||||
|
|
|
@ -204,8 +204,7 @@ impl GlobalState {
|
|||
if let Some((method, start)) = self.req_queue.incoming.complete(response.id.clone()) {
|
||||
let duration = start.elapsed();
|
||||
log::info!("handled req#{} in {:?}", response.id, duration);
|
||||
let metrics =
|
||||
RequestMetrics { id: response.id.clone(), method: method.to_string(), duration };
|
||||
let metrics = RequestMetrics { id: response.id.clone(), method, duration };
|
||||
self.latest_requests.write().record(metrics);
|
||||
self.send(response.into());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue