Skip to content

Commit e5c1772

Browse files
committed
[topo] Addressing clippy warnings surfaced by uniform build args!
1 parent f73cda7 commit e5c1772

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

topo/macro/src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ pub fn topo(_attrs: TokenStream, input: TokenStream) -> TokenStream {
5757

5858
for attr in tmp {
5959
match attr.parse_meta() {
60-
Ok(syn::Meta::NameValue(syn::MetaNameValue { ref ident, .. }))
61-
if ident.to_string() == "doc" =>
62-
{
60+
Ok(syn::Meta::NameValue(syn::MetaNameValue { ref ident, .. })) if *ident == "doc" => {
6361
doc_attrs.push(attr);
6462
}
6563
_ => input_fn.attrs.push(attr),
@@ -99,9 +97,9 @@ fn docs_fn_signature(input_fn: &syn::ItemFn) -> TokenStream2 {
9997
let doc_fn_sig = syn::ItemFn {
10098
attrs: vec![],
10199
vis: syn::Visibility::Inherited,
102-
constness: input_fn.constness.clone(),
103-
asyncness: input_fn.asyncness.clone(),
104-
unsafety: input_fn.unsafety.clone(),
100+
constness: input_fn.constness,
101+
asyncness: input_fn.asyncness,
102+
unsafety: input_fn.unsafety,
105103
abi: input_fn.abi.clone(),
106104
ident: input_fn.ident.clone(),
107105
decl: input_fn.decl.clone(),

topo/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ use {
5353
std::{
5454
any::{Any, TypeId},
5555
cell::RefCell,
56-
collections::HashMap,
56+
collections::{hash_map::DefaultHasher, HashMap},
5757
hash::{Hash, Hasher},
5858
ops::Deref,
5959
rc::Rc,
@@ -158,7 +158,7 @@ impl Eq for Point {}
158158
impl Point {
159159
fn id(&self) -> Id {
160160
// FIXME probably need a better hash function?
161-
let mut hasher = std::collections::hash_map::DefaultHasher::new();
161+
let mut hasher = DefaultHasher::new();
162162
self.path.hash(&mut hasher);
163163
self.prev_sibling.hash(&mut hasher);
164164
Id(hasher.finish())
@@ -313,7 +313,7 @@ mod tests {
313313
fn clone(first: &Point) -> Point {
314314
Point {
315315
path: first.path.clone(),
316-
prev_sibling: first.prev_sibling.clone(),
316+
prev_sibling: first.prev_sibling,
317317
env: first.env.clone(),
318318
}
319319
}

0 commit comments

Comments
 (0)