diff options
author | cynecx <[email protected]> | 2021-01-02 19:58:06 +0000 |
---|---|---|
committer | cynecx <[email protected]> | 2021-01-02 19:58:53 +0000 |
commit | 3e9847f7474b0df893351e4e1fe57dcb6f6171bd (patch) | |
tree | f4c040a10f69b66aecd672406d69544e30742a8c /crates/hir_def/src | |
parent | 59fe884ef5ea2e0939d6a29c64c061569c0690bb (diff) |
Use fully qualified `Itertools::intersperse` call to silence nightly warnings about a potential name collision due to recent libstd api additions
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r-- | crates/hir_def/src/attr.rs | 15 |
1 files changed, 7 insertions, 8 deletions
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 { | |||
260 | } | 260 | } |
261 | 261 | ||
262 | pub fn docs(&self) -> Option<Documentation> { | 262 | pub fn docs(&self) -> Option<Documentation> { |
263 | let docs = self | 263 | let docs = self.by_key("doc").attrs().flat_map(|attr| match attr.input.as_ref()? { |
264 | .by_key("doc") | 264 | AttrInput::Literal(s) => Some(s), |
265 | .attrs() | 265 | AttrInput::TokenTree(_) => None, |
266 | .flat_map(|attr| match attr.input.as_ref()? { | 266 | }); |
267 | AttrInput::Literal(s) => Some(s), | 267 | // FIXME: Replace `Itertools::intersperse` with `Iterator::intersperse[_with]` until the |
268 | AttrInput::TokenTree(_) => None, | 268 | // libstd api gets stabilized (https://github.com/rust-lang/rust/issues/79524). |
269 | }) | 269 | let docs = Itertools::intersperse(docs, &SmolStr::new_inline("\n")) |
270 | .intersperse(&SmolStr::new_inline("\n")) | ||
271 | .map(|it| it.as_str()) | 270 | .map(|it| it.as_str()) |
272 | .collect::<String>(); | 271 | .collect::<String>(); |
273 | if docs.is_empty() { | 272 | if docs.is_empty() { |