The lint group rust-2018-idioms enables elided-lifetimes-in-paths. Visitor::expecting omits the lifetime from Formatter. When relying on autocompletion, this requires one to manually add a lifetime argument to silence this warning. Would it be difficult to change this?
#![warn(rust_2018_idioms)]
use core::fmt;
use serde::de::{Error, Visitor};
pub struct Foo;
impl<'de> Visitor<'de> for Foo {
type Value = ();
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("()")
}
fn visit_unit<E>(self) -> Result<Self::Value, E>
where
E: Error,
{
Ok(())
}
}
The lint group
rust-2018-idioms
enableselided-lifetimes-in-paths
.Visitor::expecting
omits the lifetime fromFormatter
. When relying on autocompletion, this requires one to manually add a lifetime argument to silence this warning. Would it be difficult to change this?expecting
was autocompleted in Helix.In contrast if the definition were defined with an explicit lifetime, autocompletion retains it; and no warning is issued: