Skip to content

Commit ed457f4

Browse files
committed
fix clippy
1 parent 47d1e41 commit ed457f4

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

src/de/decoder.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ impl<'context, R: Reader, C: Config, Context> DecoderImpl<'context, R, C, Contex
4444
}
4545
}
4646

47-
impl<'context, R, C: Config, Context> Sealed for DecoderImpl<'context, R, C, Context> {}
47+
impl<R, C: Config, Context> Sealed for DecoderImpl<'_, R, C, Context> {}
4848

49-
impl<'context, 'de, R: BorrowReader<'de>, C: Config, Context> BorrowDecoder<'de>
50-
for DecoderImpl<'context, R, C, Context>
49+
impl<'de, R: BorrowReader<'de>, C: Config, Context> BorrowDecoder<'de>
50+
for DecoderImpl<'_, R, C, Context>
5151
{
5252
type BR = R;
5353

@@ -56,7 +56,7 @@ impl<'context, 'de, R: BorrowReader<'de>, C: Config, Context> BorrowDecoder<'de>
5656
}
5757
}
5858

59-
impl<'context, R: Reader, C: Config, Context> Decoder for DecoderImpl<'context, R, C, Context> {
59+
impl<R: Reader, C: Config, Context> Decoder for DecoderImpl<'_, R, C, Context> {
6060
type R = R;
6161

6262
type C = C;
@@ -103,22 +103,22 @@ impl<'context, R: Reader, C: Config, Context> Decoder for DecoderImpl<'context,
103103
}
104104
}
105105

106-
pub struct WithContext<'a, D: ?Sized, C> {
106+
pub struct WithContext<'a, 'context, D: ?Sized, C> {
107107
pub(crate) decoder: &'a mut D,
108-
pub(crate) context: &'a mut C,
108+
pub(crate) context: &'context mut C,
109109
}
110110

111-
impl<'a, C, D: Decoder + ?Sized> Sealed for WithContext<'a, D, C> {}
111+
impl<C, D: Decoder + ?Sized> Sealed for WithContext<'_, '_, D, C> {}
112112

113-
impl<'a, Context, D: Decoder + ?Sized> Decoder for WithContext<'a, D, Context> {
113+
impl<Context, D: Decoder + ?Sized> Decoder for WithContext<'_, '_, D, Context> {
114114
type R = D::R;
115115

116116
type C = D::C;
117117

118118
type Context = Context;
119119

120120
fn context(&mut self) -> &mut Self::Context {
121-
&mut self.context
121+
self.context
122122
}
123123

124124
fn reader(&mut self) -> &mut Self::R {
@@ -138,7 +138,7 @@ impl<'a, Context, D: Decoder + ?Sized> Decoder for WithContext<'a, D, Context> {
138138
}
139139
}
140140

141-
impl<'de, 'a, C, D: BorrowDecoder<'de>> BorrowDecoder<'de> for WithContext<'a, D, C> {
141+
impl<'de, C, D: BorrowDecoder<'de>> BorrowDecoder<'de> for WithContext<'_, '_, D, C> {
142142
type BR = D::BR;
143143
fn borrow_reader(&mut self) -> &mut Self::BR {
144144
self.decoder.borrow_reader()

src/de/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ pub trait Decoder: Sealed {
158158
/// Returns the decoding context
159159
fn context(&mut self) -> &mut Self::Context;
160160

161-
fn with_context<'a, C>(&'a mut self, context: &'a mut C) -> WithContext<'a, Self, C> {
161+
fn with_context<'a, 'context, C>(
162+
&'a mut self,
163+
context: &'context mut C,
164+
) -> WithContext<'a, 'context, Self, C> {
162165
WithContext {
163166
decoder: self,
164167
context,

0 commit comments

Comments
 (0)