@@ -49,6 +49,10 @@ impl TimeZero {
4949 /// To avoid that, we make sure that this sets the base time using the first value
5050 /// it sees if it is in the past. If it is not, then use `Instant::now()` instead.
5151 pub fn baseline ( t : Instant ) -> Self {
52+ #[ expect(
53+ clippy:: disallowed_methods,
54+ reason = "Special handling for NSPR time conversion"
55+ ) ]
5256 let now = Instant :: now ( ) ;
5357 let prnow = unsafe { PR_Now ( ) } ;
5458
@@ -75,6 +79,10 @@ static BASE_TIME: OnceCell<TimeZero> = OnceCell::new();
7579
7680fn get_base ( ) -> & ' static TimeZero {
7781 BASE_TIME . get_or_init ( || TimeZero {
82+ #[ expect(
83+ clippy:: disallowed_methods,
84+ reason = "Special handling for NSPR time conversion"
85+ ) ]
7886 instant : Instant :: now ( ) ,
7987 prtime : unsafe { PR_Now ( ) } ,
8088 } )
@@ -256,13 +264,15 @@ mod test {
256264 }
257265
258266 #[ test]
267+ #[ expect( clippy:: disallowed_methods, reason = "Test for special time handling" ) ]
259268 fn timezero_baseline_future ( ) {
260269 let tz = TimeZero :: baseline ( Instant :: now ( ) + Duration :: from_secs ( 10 ) ) ;
261270 let now = Instant :: now ( ) ;
262271 assert ! ( tz. instant <= now && tz. instant + Duration :: from_millis( 100 ) > now) ;
263272 }
264273
265274 #[ test]
275+ #[ expect( clippy:: disallowed_methods, reason = "Test for special time handling" ) ]
266276 fn timezero_baseline_past ( ) {
267277 let past = Instant :: now ( ) . checked_sub ( Duration :: from_secs ( 5 ) ) . unwrap ( ) ;
268278 assert_eq ! ( TimeZero :: baseline( past) . instant, past) ;
0 commit comments