Skip to content

Commit 884843a

Browse files
authored
Unrolled build for rust-lang#131403
Rollup merge of rust-lang#131403 - practicalrs:fix_needless_lifetimes_p2, r=petrochenkov Fix needless_lifetimes in rustc_serialize Hi, This PR fixes the following clipy warnings: ``` warning: the following explicit lifetimes could be elided: 'a --> compiler/rustc_serialize/src/serialize.rs:328:6 | 328 | impl<'a, S: Encoder, T: Encodable<S>> Encodable<S> for Cow<'a, [T]> | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `#[warn(clippy::needless_lifetimes)]` on by default help: elide the lifetimes | 328 - impl<'a, S: Encoder, T: Encodable<S>> Encodable<S> for Cow<'a, [T]> 328 + impl<S: Encoder, T: Encodable<S>> Encodable<S> for Cow<'_, [T]> | warning: the following explicit lifetimes could be elided: 'a --> compiler/rustc_serialize/src/serialize.rs:348:6 | 348 | impl<'a, S: Encoder> Encodable<S> for Cow<'a, str> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 348 - impl<'a, S: Encoder> Encodable<S> for Cow<'a, str> { 348 + impl<S: Encoder> Encodable<S> for Cow<'_, str> { | warning: the following explicit lifetimes could be elided: 'a --> compiler/rustc_serialize/src/serialize.rs:355:6 | 355 | impl<'a, D: Decoder> Decodable<D> for Cow<'a, str> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 355 - impl<'a, D: Decoder> Decodable<D> for Cow<'a, str> { 355 + impl<D: Decoder> Decodable<D> for Cow<'_, str> { ``` Best regards, Michal
2 parents fc0f045 + 7ab4666 commit 884843a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_serialize/src/serialize.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ impl<D: Decoder, const N: usize> Decodable<D> for [u8; N] {
325325
}
326326
}
327327

328-
impl<'a, S: Encoder, T: Encodable<S>> Encodable<S> for Cow<'a, [T]>
328+
impl<S: Encoder, T: Encodable<S>> Encodable<S> for Cow<'_, [T]>
329329
where
330330
[T]: ToOwned<Owned = Vec<T>>,
331331
{
@@ -345,14 +345,14 @@ where
345345
}
346346
}
347347

348-
impl<'a, S: Encoder> Encodable<S> for Cow<'a, str> {
348+
impl<S: Encoder> Encodable<S> for Cow<'_, str> {
349349
fn encode(&self, s: &mut S) {
350350
let val: &str = self;
351351
val.encode(s)
352352
}
353353
}
354354

355-
impl<'a, D: Decoder> Decodable<D> for Cow<'a, str> {
355+
impl<D: Decoder> Decodable<D> for Cow<'_, str> {
356356
fn decode(d: &mut D) -> Cow<'static, str> {
357357
let v: String = Decodable::decode(d);
358358
Cow::Owned(v)

0 commit comments

Comments
 (0)