File tree Expand file tree Collapse file tree 5 files changed +12
-5
lines changed Expand file tree Collapse file tree 5 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -309,17 +309,20 @@ impl fmt::Debug for Headers {
309
309
310
310
// ===== util =====
311
311
312
- pub fn parse_u64 ( src : & [ u8 ] ) -> Result < u64 , ( ) > {
312
+ #[ derive( Debug , PartialEq , Eq ) ]
313
+ pub struct ParseU64Error ;
314
+
315
+ pub fn parse_u64 ( src : & [ u8 ] ) -> Result < u64 , ParseU64Error > {
313
316
if src. len ( ) > 19 {
314
317
// At danger for overflow...
315
- return Err ( ( ) ) ;
318
+ return Err ( ParseU64Error ) ;
316
319
}
317
320
318
321
let mut ret = 0 ;
319
322
320
323
for & d in src {
321
324
if !( b'0' ..=b'9' ) . contains ( & d) {
322
- return Err ( ( ) ) ;
325
+ return Err ( ParseU64Error ) ;
323
326
}
324
327
325
328
ret *= 10 ;
@@ -333,7 +336,7 @@ pub fn parse_u64(src: &[u8]) -> Result<u64, ()> {
333
336
334
337
#[ derive( Debug ) ]
335
338
pub enum PushPromiseHeaderError {
336
- InvalidContentLength ( Result < u64 , ( ) > ) ,
339
+ InvalidContentLength ( Result < u64 , ParseU64Error > ) ,
337
340
NotSafeAndCacheable ,
338
341
}
339
342
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ mod send;
7
7
mod state;
8
8
mod store;
9
9
mod stream;
10
+ #[ allow( clippy:: module_inception) ]
10
11
mod streams;
11
12
12
13
pub ( crate ) use self :: prioritize:: Prioritized ;
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ impl Recv {
178
178
if let Some ( content_length) = frame. fields ( ) . get ( header:: CONTENT_LENGTH ) {
179
179
let content_length = match frame:: parse_u64 ( content_length. as_bytes ( ) ) {
180
180
Ok ( v) => v,
181
- Err ( ( ) ) => {
181
+ Err ( _ ) => {
182
182
proto_err ! ( stream: "could not parse content-length; stream={:?}" , stream. id) ;
183
183
return Err ( Error :: library_reset ( stream. id , Reason :: PROTOCOL_ERROR ) . into ( ) ) ;
184
184
}
@@ -263,6 +263,7 @@ impl Recv {
263
263
}
264
264
265
265
/// Called by the client to get pushed response
266
+ #[ allow( clippy:: type_complexity) ]
266
267
pub fn poll_pushed (
267
268
& mut self ,
268
269
cx : & Context ,
Original file line number Diff line number Diff line change @@ -1270,6 +1270,7 @@ impl OpaqueStreamRef {
1270
1270
me. actions . recv . poll_response ( cx, & mut stream)
1271
1271
}
1272
1272
/// Called by a client to check for a pushed request.
1273
+ #[ allow( clippy:: type_complexity) ]
1273
1274
pub fn poll_pushed (
1274
1275
& mut self ,
1275
1276
cx : & Context ,
Original file line number Diff line number Diff line change @@ -407,6 +407,7 @@ where
407
407
}
408
408
409
409
#[ doc( hidden) ]
410
+ #[ allow( clippy:: type_complexity) ]
410
411
pub fn poll_accept (
411
412
& mut self ,
412
413
cx : & mut Context < ' _ > ,
You can’t perform that action at this time.
0 commit comments