Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/doc_links.rs')
-rw-r--r--crates/ide/src/doc_links.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs
index f221985719..dbe6a5507c 100644
--- a/crates/ide/src/doc_links.rs
+++ b/crates/ide/src/doc_links.rs
@@ -58,7 +58,7 @@ pub(crate) fn rewrite_links(db: &RootDatabase, markdown: &str, definition: Defin
// and valid URLs so we choose to be too eager to try to resolve what might be
// a URL.
if target.contains("://") {
- (Some(LinkType::Inline), target.to_string(), title.to_string())
+ (Some(LinkType::Inline), target.to_owned(), title.to_owned())
} else {
// Two possibilities:
// * path-based links: `../../module/struct.MyStruct.html`
@@ -66,9 +66,9 @@ pub(crate) fn rewrite_links(db: &RootDatabase, markdown: &str, definition: Defin
if let Some((target, title)) = rewrite_intra_doc_link(db, definition, target, title) {
(None, target, title)
} else if let Some(target) = rewrite_url_link(db, definition, target) {
- (Some(LinkType::Inline), target, title.to_string())
+ (Some(LinkType::Inline), target, title.to_owned())
} else {
- (None, target.to_string(), title.to_string())
+ (None, target.to_owned(), title.to_owned())
}
}
});
@@ -186,7 +186,7 @@ pub(crate) fn extract_definitions_from_docs(
let (link, ns) = parse_intra_doc_link(&target);
Some((
TextRange::new(range.start.try_into().ok()?, range.end.try_into().ok()?),
- link.to_string(),
+ link.to_owned(),
ns,
))
}
@@ -388,7 +388,7 @@ fn rewrite_intra_doc_link(
url = url.join(&file).ok()?;
url.set_fragment(anchor);
- Some((url.into(), strip_prefixes_suffixes(title).to_string()))
+ Some((url.into(), strip_prefixes_suffixes(title).to_owned()))
}
/// Try to resolve path to local documentation via path-based links (i.e. `../gateway/struct.Shard.html`).
@@ -668,7 +668,7 @@ fn get_assoc_item_fragment(db: &dyn HirDatabase, assoc_item: hir::AssocItem) ->
Some(match assoc_item {
AssocItem::Function(function) => {
let is_trait_method =
- function.as_assoc_item(db).and_then(|assoc| assoc.containing_trait(db)).is_some();
+ function.as_assoc_item(db).and_then(|assoc| assoc.container_trait(db)).is_some();
// This distinction may get more complicated when specialization is available.
// Rustdoc makes this decision based on whether a method 'has defaultness'.
// Currently this is only the case for provided trait methods.