Fix needless_lifetimes in rustc_serialize

This commit is contained in:
Michal Piotrowski 2024-10-08 15:17:45 +02:00
parent cf24c73141
commit 7ab466697f
No known key found for this signature in database
GPG Key ID: 2538DC6C8E7C7859

View File

@ -325,7 +325,7 @@ fn encode(&self, s: &mut S) {
} }
} }
impl<'a, S: Encoder, T: Encodable<S>> Encodable<S> for Cow<'a, [T]> impl<S: Encoder, T: Encodable<S>> Encodable<S> for Cow<'_, [T]>
where where
[T]: ToOwned<Owned = Vec<T>>, [T]: ToOwned<Owned = Vec<T>>,
{ {
@ -345,14 +345,14 @@ fn decode(d: &mut D) -> Cow<'static, [T]> {
} }
} }
impl<'a, S: Encoder> Encodable<S> for Cow<'a, str> { impl<S: Encoder> Encodable<S> for Cow<'_, str> {
fn encode(&self, s: &mut S) { fn encode(&self, s: &mut S) {
let val: &str = self; let val: &str = self;
val.encode(s) val.encode(s)
} }
} }
impl<'a, D: Decoder> Decodable<D> for Cow<'a, str> { impl<D: Decoder> Decodable<D> for Cow<'_, str> {
fn decode(d: &mut D) -> Cow<'static, str> { fn decode(d: &mut D) -> Cow<'static, str> {
let v: String = Decodable::decode(d); let v: String = Decodable::decode(d);
Cow::Owned(v) Cow::Owned(v)