mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-23 13:13:17 +00:00
Use fully qualified Itertools::intersperse
call to silence nightly warnings about a potential name collision due to recent libstd api additions
This commit is contained in:
parent
59fe884ef5
commit
3e9847f747
@ -260,14 +260,13 @@ impl Attrs {
|
||||
}
|
||||
|
||||
pub fn docs(&self) -> Option<Documentation> {
|
||||
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::<String>();
|
||||
if docs.is_empty() {
|
||||
|
Loading…
Reference in New Issue
Block a user