Skip to content

Commit cdff22f

Browse files
Update vm/src/stdlib/time.rs
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 435159e commit cdff22f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vm/src/stdlib/time.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,9 +715,9 @@ mod platform {
715715
} else {
716716
return Err(vm.new_type_error("sleep() argument must be a number"));
717717
};
718-
if !secs.is_finite() || secs < 0.0 || secs > u64::MAX as f64 {
719-
return Err(vm.new_value_error("sleep length must be a non-negative finite number"));
720-
}
718+
if !secs.is_finite() || secs < 0.0 || secs > u64::MAX as f64 {
719+
return Err(vm.new_value_error("sleep length must be a non-negative finite number"));
720+
}
721721
let dur = Duration::from_secs_f64(secs);
722722
let ts = TimeSpec::from(dur);
723723
let res = unsafe { libc::nanosleep(ts.as_ref(), std::ptr::null_mut()) };

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy