5263: Fix some clippy perf warnings r=matklad a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
This commit is contained in:
bors[bot] 2020-07-08 13:55:56 +00:00 committed by GitHub
commit a622a8e109
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View file

@ -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),
}

View file

@ -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

View file

@ -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());
}