Skip to content

Commit 0ac0f79

Browse files
committed
Add some docs
1 parent 2229045 commit 0ac0f79

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/file/src/blob.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use sealed::Sealed;
1010
/// This trait is used to overload the `Blob::new_with_options` function, allowing a variety of
1111
/// types to be used to create a `Blob`. Ignore this, and use &[u8], &str, etc to create a `Blob`.
1212
///
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
1414
/// crate, as this crate relies on invariants regarding the `JsValue` returned from `into_jsvalue`.
1515
pub trait BlobContents: Sealed {
1616
fn into_jsvalue(self) -> JsValue;
@@ -289,6 +289,7 @@ impl From<File> for Blob {
289289
/// [Number.MAX_SAFE_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)
290290
fn safe_u64_to_f64(number: u64) -> f64 {
291291
// Max integer stably representable by f64
292+
// todo use js_sys::Number::MAX_SAFE_INTEGER once stable
292293
const MAX_SAFE_INTEGER: u64 = 9007199254740991; // (2^53 - 1)
293294
assert!(
294295
number <= MAX_SAFE_INTEGER,
@@ -302,6 +303,7 @@ fn safe_u64_to_f64(number: u64) -> f64 {
302303

303304
fn safe_u128_to_f64(number: u128) -> f64 {
304305
// Max integer stably representable by f64
306+
// todo use js_sys::Number::MAX_SAFE_INTEGER once stable
305307
const MAX_SAFE_INTEGER: u128 = 9007199254740991; // (2^53 - 1)
306308
assert!(
307309
number <= MAX_SAFE_INTEGER,
@@ -316,6 +318,7 @@ fn safe_u128_to_f64(number: u128) -> f64 {
316318
/// Like safe_u64_to_f64, but additionally checks that the number is an integer.
317319
fn safe_f64_to_u64(number: f64) -> u64 {
318320
// Max integer stably representable by f64
321+
// todo use js_sys::Number::MAX_SAFE_INTEGER once stable
319322
const MAX_SAFE_INTEGER: f64 = 9007199254740991.0; // (2^53 - 1)
320323
assert!(
321324
number <= MAX_SAFE_INTEGER,

0 commit comments

Comments
 (0)