@@ -5,6 +5,7 @@ use crate::frame::{
55use crate :: proto:: Error ;
66
77use crate :: hpack;
8+ use crate :: tracing;
89
910use futures_core:: Stream ;
1011
@@ -126,8 +127,7 @@ fn decode_frame(
126127 partial_inout : & mut Option < Partial > ,
127128 mut bytes : BytesMut ,
128129) -> Result < Option < Frame > , Error > {
129- let span = tracing:: trace_span!( "FramedRead::decode_frame" , offset = bytes. len( ) ) ;
130- let _e = span. enter ( ) ;
130+ let _span = tracing:: trace_span!( "FramedRead::decode_frame" , offset = bytes. len( ) ) ;
131131
132132 tracing:: trace!( "decoding frame from {}B" , bytes. len( ) ) ;
133133
@@ -158,8 +158,8 @@ fn decode_frame(
158158 // `PROTOCOL_ERROR`.
159159 return Err ( Error :: library_reset( $head. stream_id( ) , Reason :: PROTOCOL_ERROR ) ) ;
160160 } ,
161- Err ( e ) => {
162- proto_err!( conn: "failed to load frame; err={:?}" , e ) ;
161+ Err ( _e ) => {
162+ proto_err!( conn: "failed to load frame; err={:?}" , _e ) ;
163163 return Err ( Error :: library_go_away( Reason :: PROTOCOL_ERROR ) ) ;
164164 }
165165 } ;
@@ -175,8 +175,8 @@ fn decode_frame(
175175 proto_err!( stream: "malformed header block; stream={:?}" , id) ;
176176 return Err ( Error :: library_reset( id, Reason :: PROTOCOL_ERROR ) ) ;
177177 } ,
178- Err ( e ) => {
179- proto_err!( conn: "failed HPACK decoding; err={:?}" , e ) ;
178+ Err ( _e ) => {
179+ proto_err!( conn: "failed HPACK decoding; err={:?}" , _e ) ;
180180 return Err ( Error :: library_go_away( Reason :: PROTOCOL_ERROR ) ) ;
181181 }
182182 }
@@ -201,26 +201,26 @@ fn decode_frame(
201201 Kind :: Settings => {
202202 let res = frame:: Settings :: load ( head, & bytes[ frame:: HEADER_LEN ..] ) ;
203203
204- res. map_err ( |e | {
205- proto_err ! ( conn: "failed to load SETTINGS frame; err={:?}" , e ) ;
204+ res. map_err ( |_e | {
205+ proto_err ! ( conn: "failed to load SETTINGS frame; err={:?}" , _e ) ;
206206 Error :: library_go_away ( Reason :: PROTOCOL_ERROR )
207207 } ) ?
208208 . into ( )
209209 }
210210 Kind :: Ping => {
211211 let res = frame:: Ping :: load ( head, & bytes[ frame:: HEADER_LEN ..] ) ;
212212
213- res. map_err ( |e | {
214- proto_err ! ( conn: "failed to load PING frame; err={:?}" , e ) ;
213+ res. map_err ( |_e | {
214+ proto_err ! ( conn: "failed to load PING frame; err={:?}" , _e ) ;
215215 Error :: library_go_away ( Reason :: PROTOCOL_ERROR )
216216 } ) ?
217217 . into ( )
218218 }
219219 Kind :: WindowUpdate => {
220220 let res = frame:: WindowUpdate :: load ( head, & bytes[ frame:: HEADER_LEN ..] ) ;
221221
222- res. map_err ( |e | {
223- proto_err ! ( conn: "failed to load WINDOW_UPDATE frame; err={:?}" , e ) ;
222+ res. map_err ( |_e | {
223+ proto_err ! ( conn: "failed to load WINDOW_UPDATE frame; err={:?}" , _e ) ;
224224 Error :: library_go_away ( Reason :: PROTOCOL_ERROR )
225225 } ) ?
226226 . into ( )
@@ -230,25 +230,25 @@ fn decode_frame(
230230 let res = frame:: Data :: load ( head, bytes. freeze ( ) ) ;
231231
232232 // TODO: Should this always be connection level? Probably not...
233- res. map_err ( |e | {
234- proto_err ! ( conn: "failed to load DATA frame; err={:?}" , e ) ;
233+ res. map_err ( |_e | {
234+ proto_err ! ( conn: "failed to load DATA frame; err={:?}" , _e ) ;
235235 Error :: library_go_away ( Reason :: PROTOCOL_ERROR )
236236 } ) ?
237237 . into ( )
238238 }
239239 Kind :: Headers => header_block ! ( Headers , head, bytes) ,
240240 Kind :: Reset => {
241241 let res = frame:: Reset :: load ( head, & bytes[ frame:: HEADER_LEN ..] ) ;
242- res. map_err ( |e | {
243- proto_err ! ( conn: "failed to load RESET frame; err={:?}" , e ) ;
242+ res. map_err ( |_e | {
243+ proto_err ! ( conn: "failed to load RESET frame; err={:?}" , _e ) ;
244244 Error :: library_go_away ( Reason :: PROTOCOL_ERROR )
245245 } ) ?
246246 . into ( )
247247 }
248248 Kind :: GoAway => {
249249 let res = frame:: GoAway :: load ( & bytes[ frame:: HEADER_LEN ..] ) ;
250- res. map_err ( |e | {
251- proto_err ! ( conn: "failed to load GO_AWAY frame; err={:?}" , e ) ;
250+ res. map_err ( |_e | {
251+ proto_err ! ( conn: "failed to load GO_AWAY frame; err={:?}" , _e ) ;
252252 Error :: library_go_away ( Reason :: PROTOCOL_ERROR )
253253 } ) ?
254254 . into ( )
@@ -271,8 +271,8 @@ fn decode_frame(
271271 proto_err ! ( stream: "PRIORITY invalid dependency ID; stream={:?}" , id) ;
272272 return Err ( Error :: library_reset ( id, Reason :: PROTOCOL_ERROR ) ) ;
273273 }
274- Err ( e ) => {
275- proto_err ! ( conn: "failed to load PRIORITY frame; err={:?};" , e ) ;
274+ Err ( _e ) => {
275+ proto_err ! ( conn: "failed to load PRIORITY frame; err={:?};" , _e ) ;
276276 return Err ( Error :: library_go_away ( Reason :: PROTOCOL_ERROR ) ) ;
277277 }
278278 }
@@ -347,8 +347,8 @@ fn decode_frame(
347347 proto_err ! ( stream: "malformed CONTINUATION frame; stream={:?}" , id) ;
348348 return Err ( Error :: library_reset ( id, Reason :: PROTOCOL_ERROR ) ) ;
349349 }
350- Err ( e ) => {
351- proto_err ! ( conn: "failed HPACK decoding; err={:?}" , e ) ;
350+ Err ( _e ) => {
351+ proto_err ! ( conn: "failed HPACK decoding; err={:?}" , _e ) ;
352352 return Err ( Error :: library_go_away ( Reason :: PROTOCOL_ERROR ) ) ;
353353 }
354354 }
@@ -376,8 +376,7 @@ where
376376 type Item = Result < Frame , Error > ;
377377
378378 fn poll_next ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Option < Self :: Item > > {
379- let span = tracing:: trace_span!( "FramedRead::poll_next" ) ;
380- let _e = span. enter ( ) ;
379+ let _span = tracing:: trace_span!( "FramedRead::poll_next" ) ;
381380 loop {
382381 tracing:: trace!( "poll" ) ;
383382 let bytes = match ready ! ( Pin :: new( & mut self . inner) . poll_next( cx) ) {
0 commit comments