@@ -23,7 +23,7 @@ use crate::routing::router::{InFlightHtlcs, Path, PaymentParameters, Route, Rout
2323use crate :: util:: errors:: APIError ;
2424use crate :: util:: logger:: Logger ;
2525use crate :: util:: time:: Time ;
26- #[ cfg( all( not ( feature = "no- std" ) , test) ) ]
26+ #[ cfg( all( feature = "std" , test) ) ]
2727use crate :: util:: time:: tests:: SinceEpoch ;
2828use crate :: util:: ser:: ReadableArgs ;
2929
@@ -282,21 +282,21 @@ pub enum Retry {
282282 /// retry, and may retry multiple failed HTLCs at once if they failed around the same time and
283283 /// were retried along a route from a single call to [`Router::find_route_with_id`].
284284 Attempts ( u32 ) ,
285- #[ cfg( not ( feature = "no- std" ) ) ]
285+ #[ cfg( feature = "std" ) ]
286286 /// Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
287287 /// see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
288288 ///
289289 /// [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
290290 Timeout ( core:: time:: Duration ) ,
291291}
292292
293- #[ cfg( feature = "no- std" ) ]
293+ #[ cfg( not ( feature = "std" ) ) ]
294294impl_writeable_tlv_based_enum ! ( Retry ,
295295 ;
296296 ( 0 , Attempts )
297297) ;
298298
299- #[ cfg( not ( feature = "no- std" ) ) ]
299+ #[ cfg( feature = "std" ) ]
300300impl_writeable_tlv_based_enum ! ( Retry ,
301301 ;
302302 ( 0 , Attempts ) ,
@@ -309,10 +309,10 @@ impl Retry {
309309 ( Retry :: Attempts ( max_retry_count) , PaymentAttempts { count, .. } ) => {
310310 max_retry_count > count
311311 } ,
312- #[ cfg( all( not ( feature = "no- std" ) , not( test) ) ) ]
312+ #[ cfg( all( feature = "std" , not( test) ) ) ]
313313 ( Retry :: Timeout ( max_duration) , PaymentAttempts { first_attempted_at, .. } ) =>
314314 * max_duration >= crate :: util:: time:: MonotonicTime :: now ( ) . duration_since ( * first_attempted_at) ,
315- #[ cfg( all( not ( feature = "no- std" ) , test) ) ]
315+ #[ cfg( all( feature = "std" , test) ) ]
316316 ( Retry :: Timeout ( max_duration) , PaymentAttempts { first_attempted_at, .. } ) =>
317317 * max_duration >= SinceEpoch :: now ( ) . duration_since ( * first_attempted_at) ,
318318 }
@@ -338,37 +338,37 @@ pub(crate) struct PaymentAttemptsUsingTime<T: Time> {
338338 /// it means the result of the first attempt is not known yet.
339339 pub ( crate ) count : u32 ,
340340 /// This field is only used when retry is `Retry::Timeout` which is only build with feature std
341- #[ cfg( not ( feature = "no- std" ) ) ]
341+ #[ cfg( feature = "std" ) ]
342342 first_attempted_at : T ,
343- #[ cfg( feature = "no- std" ) ]
343+ #[ cfg( not ( feature = "std" ) ) ]
344344 phantom : core:: marker:: PhantomData < T > ,
345345
346346}
347347
348- #[ cfg( not( any( feature = "no- std" , test) ) ) ]
348+ #[ cfg( not( any( not ( feature = "std" ) , test) ) ) ]
349349type ConfiguredTime = crate :: util:: time:: MonotonicTime ;
350- #[ cfg( feature = "no- std" ) ]
350+ #[ cfg( not ( feature = "std" ) ) ]
351351type ConfiguredTime = crate :: util:: time:: Eternity ;
352- #[ cfg( all( not ( feature = "no- std" ) , test) ) ]
352+ #[ cfg( all( feature = "std" , test) ) ]
353353type ConfiguredTime = SinceEpoch ;
354354
355355impl < T : Time > PaymentAttemptsUsingTime < T > {
356356 pub ( crate ) fn new ( ) -> Self {
357357 PaymentAttemptsUsingTime {
358358 count : 0 ,
359- #[ cfg( not ( feature = "no- std" ) ) ]
359+ #[ cfg( feature = "std" ) ]
360360 first_attempted_at : T :: now ( ) ,
361- #[ cfg( feature = "no- std" ) ]
361+ #[ cfg( not ( feature = "std" ) ) ]
362362 phantom : core:: marker:: PhantomData ,
363363 }
364364 }
365365}
366366
367367impl < T : Time > Display for PaymentAttemptsUsingTime < T > {
368368 fn fmt ( & self , f : & mut Formatter ) -> Result < ( ) , fmt:: Error > {
369- #[ cfg( feature = "no- std" ) ]
369+ #[ cfg( not ( feature = "std" ) ) ]
370370 return write ! ( f, "attempts: {}" , self . count) ;
371- #[ cfg( not ( feature = "no- std" ) ) ]
371+ #[ cfg( feature = "std" ) ]
372372 return write ! (
373373 f,
374374 "attempts: {}, duration: {}s" ,
0 commit comments