From 3e9847f7474b0df893351e4e1fe57dcb6f6171bd Mon Sep 17 00:00:00 2001 From: cynecx Date: Sat, 2 Jan 2021 20:58:06 +0100 Subject: Use fully qualified `Itertools::intersperse` call to silence nightly warnings about a potential name collision due to recent libstd api additions --- crates/hir_def/src/attr.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'crates/hir_def/src') diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs index 042e119b1..fcf638e0f 100644 --- a/crates/hir_def/src/attr.rs +++ b/crates/hir_def/src/attr.rs @@ -260,14 +260,13 @@ impl Attrs { } pub fn docs(&self) -> Option { - let docs = self - .by_key("doc") - .attrs() - .flat_map(|attr| match attr.input.as_ref()? { - AttrInput::Literal(s) => Some(s), - AttrInput::TokenTree(_) => None, - }) - .intersperse(&SmolStr::new_inline("\n")) + let docs = self.by_key("doc").attrs().flat_map(|attr| match attr.input.as_ref()? { + AttrInput::Literal(s) => Some(s), + AttrInput::TokenTree(_) => None, + }); + // FIXME: Replace `Itertools::intersperse` with `Iterator::intersperse[_with]` until the + // libstd api gets stabilized (https://github.com/rust-lang/rust/issues/79524). + let docs = Itertools::intersperse(docs, &SmolStr::new_inline("\n")) .map(|it| it.as_str()) .collect::(); if docs.is_empty() { -- cgit v1.2.3