Skip to content

Commit

Permalink
Fix needless_lifetimes in rustc_serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalrs committed Oct 8, 2024
1 parent cf24c73 commit 7ab4666
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_serialize/src/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ impl<D: Decoder, const N: usize> Decodable<D> for [u8; N] {
}
}

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
[T]: ToOwned<Owned = Vec<T>>,
{
Expand All @@ -345,14 +345,14 @@ where
}
}

impl<'a, S: Encoder> Encodable<S> for Cow<'a, str> {
impl<S: Encoder> Encodable<S> for Cow<'_, str> {
fn encode(&self, s: &mut S) {
let val: &str = self;
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> {
let v: String = Decodable::decode(d);
Cow::Owned(v)
Expand Down

0 comments on commit 7ab4666

Please sign in to comment.