@@ -33,6 +33,7 @@ impl Time {
3333 #[ cfg( all( any( feature = "client" , feature = "server" ) , feature = "http2" ) ) ]
3434 pub ( crate ) fn sleep ( & self , duration : Duration ) -> Pin < Box < dyn Sleep > > {
3535 match & self {
36+ #[ allow( clippy:: panic, reason="Reachable only through user misconfiguration" ) ]
3637 Time :: Empty => {
3738 panic ! ( "You must supply a timer." )
3839 }
@@ -43,6 +44,7 @@ impl Time {
4344 #[ cfg( all( feature = "server" , feature = "http1" ) ) ]
4445 pub ( crate ) fn sleep_until ( & self , deadline : Instant ) -> Pin < Box < dyn Sleep > > {
4546 match & self {
47+ #[ allow( clippy:: panic, reason="Reachable only through user misconfiguration" ) ]
4648 Time :: Empty => {
4749 panic ! ( "You must supply a timer." )
4850 }
@@ -59,6 +61,7 @@ impl Time {
5961
6062 pub ( crate ) fn reset ( & self , sleep : & mut Pin < Box < dyn Sleep > > , new_deadline : Instant ) {
6163 match & self {
64+ #[ allow( clippy:: panic, reason="Only reachable through internal invariant failure, our state can't be trusted" ) ]
6265 Time :: Empty => {
6366 panic ! ( "You must supply a timer." )
6467 }
@@ -77,6 +80,7 @@ impl Time {
7780 Time :: Timer ( ..) => Some ( dur) ,
7881 } ,
7982 Dur :: Configured ( Some ( dur) ) => match self {
83+ #[ allow( clippy:: panic, reason="Reachable only through user misconfiguration." ) ]
8084 Time :: Empty => panic ! ( "timeout `{name}` set, but no timer set" , ) ,
8185 Time :: Timer ( ..) => Some ( dur) ,
8286 } ,
0 commit comments