don't clone types that are copy (clippy::clone_on_copy)

This commit is contained in:
Matthias Krüger 2021-03-17 01:56:31 +01:00
parent c5d654d513
commit 048dad8c2e
12 changed files with 18 additions and 28 deletions

View file

@ -93,7 +93,7 @@ pub(crate) fn remove_links(markdown: &str) -> String {
let mut cb = |_: BrokenLink| {
let empty = InlineStr::try_from("").unwrap();
Some((CowStr::Inlined(empty.clone()), CowStr::Inlined(empty)))
Some((CowStr::Inlined(empty), CowStr::Inlined(empty)))
};
let doc = Parser::new_with_broken_link_callback(markdown, opts, Some(&mut cb));
let doc = doc.filter_map(move |evt| match evt {
@ -147,7 +147,7 @@ fn get_doc_link(db: &RootDatabase, definition: Definition) -> Option<String> {
_ => return None,
};
let ns = ItemInNs::from(target_def.clone());
let ns = ItemInNs::from(target_def);
let module = definition.module(db)?;
let krate = module.krate();