diff --git a/guide/src/design/exporting-rust-struct.md b/guide/src/design/exporting-rust-struct.md index 621ebd751..12e0db5c5 100644 --- a/guide/src/design/exporting-rust-struct.md +++ b/guide/src/design/exporting-rust-struct.md @@ -135,7 +135,7 @@ same as [`RefCell`] and can be mostly glossed over. The purpose for this type, if you're interested though, is to uphold Rust's guarantees about aliasing in a world where aliasing is rampant (JS). -Specifically the `&Foo` type means that there can be as much alaising as you'd +Specifically the `&Foo` type means that there can be as much aliasing as you'd like, but crucially `&mut Foo` means that it is the sole pointer to the data (no other `&Foo` to the same instance exists). The [`RefCell`] type in libstd is a way of dynamically enforcing this at runtime (as opposed to compile time diff --git a/guide/src/design/import-customization.md b/guide/src/design/import-customization.md index 273740392..3db5a5057 100644 --- a/guide/src/design/import-customization.md +++ b/guide/src/design/import-customization.md @@ -197,5 +197,5 @@ possibilities! } ``` - All of these functions will call `console.log` in Rust, but each identifier + All of these functions will call `console.log` in JS, but each identifier will have only one signature in Rust. diff --git a/guide/src/design/rust-type-conversions.md b/guide/src/design/rust-type-conversions.md index f5e939a2d..a6d5ab25e 100644 --- a/guide/src/design/rust-type-conversions.md +++ b/guide/src/design/rust-type-conversions.md @@ -5,7 +5,7 @@ values enter Rust. Here we'll go into some more depth about how this is implemented. There are two categories of traits for converting values, traits for converting values from Rust to JS and traits for the other way around. -### From Rust to JS +## From Rust to JS First up let's take a look at going from Rust to JS: @@ -37,7 +37,7 @@ The `IntoWasmAbi` trait is used in two locations. First it's used to convert return values of Rust exported functions to JS. Second it's used to convert the Rust arguments of JS functions imported to Rust. -### From JS to Rust +## From JS to Rust Unfortunately the opposite direction from above, going from JS to Rust, is a bit more complicated. Here we've got three traits: @@ -81,7 +81,7 @@ The `From*` family of traits are used for converting the Rust arguments in Rust exported functions to JS. They are also used for the return value in JS functions imported into Rust. -### Global stack +## Global stack Mentioned above not all Rust types will fit within 32 bits. While we can communicate an `f64` we don't necessarily have the ability to use all the bits.