Opt for .cloned() over .map(|x| x.clone()) etc.
This commit is contained in:
parent
5705d48e28
commit
2f586b9687
39 changed files with 67 additions and 81 deletions
|
|
@ -293,7 +293,7 @@ pub fn collapse_docs(krate: clean::Crate) -> plugins::PluginResult {
|
|||
let mut a: Vec<clean::Attribute> = i.attrs.iter().filter(|&a| match a {
|
||||
&clean::NameValue(ref x, _) if "doc" == *x => false,
|
||||
_ => true
|
||||
}).map(|x| x.clone()).collect();
|
||||
}).cloned().collect();
|
||||
if docstr.len() > 0 {
|
||||
a.push(clean::NameValue("doc".to_string(), docstr));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
|
|||
name: name,
|
||||
items: items.clone(),
|
||||
generics: gen.clone(),
|
||||
bounds: b.iter().map(|x| (*x).clone()).collect(),
|
||||
bounds: b.iter().cloned().collect(),
|
||||
id: item.id,
|
||||
attrs: item.attrs.clone(),
|
||||
whence: item.span,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue