@@ -10,7 +10,7 @@ use sealed::Sealed;
10
10
/// This trait is used to overload the `Blob::new_with_options` function, allowing a variety of
11
11
/// types to be used to create a `Blob`. Ignore this, and use &[u8], &str, etc to create a `Blob`.
12
12
///
13
- /// The trait is sealed: it must only be implemented by this
13
+ /// The trait is sealed: it must only be implemented by types in this
14
14
/// crate, as this crate relies on invariants regarding the `JsValue` returned from `into_jsvalue`.
15
15
pub trait BlobContents : Sealed {
16
16
fn into_jsvalue ( self ) -> JsValue ;
@@ -289,6 +289,7 @@ impl From<File> for Blob {
289
289
/// [Number.MAX_SAFE_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)
290
290
fn safe_u64_to_f64 ( number : u64 ) -> f64 {
291
291
// Max integer stably representable by f64
292
+ // todo use js_sys::Number::MAX_SAFE_INTEGER once stable
292
293
const MAX_SAFE_INTEGER : u64 = 9007199254740991 ; // (2^53 - 1)
293
294
assert ! (
294
295
number <= MAX_SAFE_INTEGER ,
@@ -302,6 +303,7 @@ fn safe_u64_to_f64(number: u64) -> f64 {
302
303
303
304
fn safe_u128_to_f64 ( number : u128 ) -> f64 {
304
305
// Max integer stably representable by f64
306
+ // todo use js_sys::Number::MAX_SAFE_INTEGER once stable
305
307
const MAX_SAFE_INTEGER : u128 = 9007199254740991 ; // (2^53 - 1)
306
308
assert ! (
307
309
number <= MAX_SAFE_INTEGER ,
@@ -316,6 +318,7 @@ fn safe_u128_to_f64(number: u128) -> f64 {
316
318
/// Like safe_u64_to_f64, but additionally checks that the number is an integer.
317
319
fn safe_f64_to_u64 ( number : f64 ) -> u64 {
318
320
// Max integer stably representable by f64
321
+ // todo use js_sys::Number::MAX_SAFE_INTEGER once stable
319
322
const MAX_SAFE_INTEGER : f64 = 9007199254740991.0 ; // (2^53 - 1)
320
323
assert ! (
321
324
number <= MAX_SAFE_INTEGER ,
0 commit comments