From ca2154889022309c7362e889124367d44f038c71 Mon Sep 17 00:00:00 2001 From: Wodann Date: Mon, 25 May 2020 16:40:05 +0200 Subject: [PATCH] docs(book): replace float with f32 --- book/listings/ch03-structs/listing01.mun | 4 ++-- book/listings/ch03-structs/listing02.mun | 2 +- book/listings/ch03-structs/listing03.mun | 4 ++-- book/listings/ch03-structs/listing04.mun | 2 +- book/listings/ch03-structs/listing05.mun | 6 +++--- book/listings/ch03-structs/listing06.mun | 4 ++-- book/listings/ch03-structs/listing07.mun | 2 +- book/listings/ch03-structs/listing09.mun | 4 ++-- book/listings/ch03-structs/listing10.mun | 4 ++-- book/listings/ch03-structs/listing11.rs | 4 ++-- book/listings/ch03-structs/listing12.rs | 6 +++--- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/book/listings/ch03-structs/listing01.mun b/book/listings/ch03-structs/listing01.mun index b170fe72c..9b0dd362a 100644 --- a/book/listings/ch03-structs/listing01.mun +++ b/book/listings/ch03-structs/listing01.mun @@ -1,4 +1,4 @@ struct Vector2 { - x: float, - y: float, + x: f32, + y: f32, } diff --git a/book/listings/ch03-structs/listing02.mun b/book/listings/ch03-structs/listing02.mun index 204910c17..ea62f2484 100644 --- a/book/listings/ch03-structs/listing02.mun +++ b/book/listings/ch03-structs/listing02.mun @@ -1 +1 @@ -struct Vector3(float, float, float) +struct Vector3(f32, f32, f32) diff --git a/book/listings/ch03-structs/listing03.mun b/book/listings/ch03-structs/listing03.mun index f5985c393..57fb017dc 100644 --- a/book/listings/ch03-structs/listing03.mun +++ b/book/listings/ch03-structs/listing03.mun @@ -1,6 +1,6 @@ # struct Vector2 { -# x: float, -# y: float, +# x: f32, +# y: f32, # } let xy = Vector2 { x: 1.0, diff --git a/book/listings/ch03-structs/listing04.mun b/book/listings/ch03-structs/listing04.mun index 556154ead..7d175d880 100644 --- a/book/listings/ch03-structs/listing04.mun +++ b/book/listings/ch03-structs/listing04.mun @@ -1,2 +1,2 @@ -# struct Vector3(float, float, float) +# struct Vector3(f32, f32, f32) let xyz = Vector3(-1.0, 0.0, 1.0); diff --git a/book/listings/ch03-structs/listing05.mun b/book/listings/ch03-structs/listing05.mun index a26152478..977da9529 100644 --- a/book/listings/ch03-structs/listing05.mun +++ b/book/listings/ch03-structs/listing05.mun @@ -1,7 +1,7 @@ # struct Vector2 { -# x: float, -# y: float, +# x: f32, +# y: f32, # } -pub fn vector2_new(x: float, y: float) -> Vector2 { +pub fn vector2_new(x: f32, y: f32) -> Vector2 { Vector2 { x, y } } diff --git a/book/listings/ch03-structs/listing06.mun b/book/listings/ch03-structs/listing06.mun index 30a0cbec0..49670aa47 100644 --- a/book/listings/ch03-structs/listing06.mun +++ b/book/listings/ch03-structs/listing06.mun @@ -1,6 +1,6 @@ # struct Vector2 { -# x: float, -# y: float, +# x: f32, +# y: f32, # } pub fn vector2_add(lhs: Vector2, rhs: Vector2) -> Vector2 { lhs.x += rhs.x; diff --git a/book/listings/ch03-structs/listing07.mun b/book/listings/ch03-structs/listing07.mun index f6e55cb75..ea196ccf1 100644 --- a/book/listings/ch03-structs/listing07.mun +++ b/book/listings/ch03-structs/listing07.mun @@ -1,4 +1,4 @@ -# struct Vector3(float, float, float) +# struct Vector3(f32, f32, f32) pub fn vector3_add(lhs: Vector3, rhs: Vector3) -> Vector3 { lhs.0 += rhs.0; lhs.1 += rhs.1; diff --git a/book/listings/ch03-structs/listing09.mun b/book/listings/ch03-structs/listing09.mun index b170fe72c..9b0dd362a 100644 --- a/book/listings/ch03-structs/listing09.mun +++ b/book/listings/ch03-structs/listing09.mun @@ -1,4 +1,4 @@ struct Vector2 { - x: float, - y: float, + x: f32, + y: f32, } diff --git a/book/listings/ch03-structs/listing10.mun b/book/listings/ch03-structs/listing10.mun index 2e3c55992..14cbffbd1 100644 --- a/book/listings/ch03-structs/listing10.mun +++ b/book/listings/ch03-structs/listing10.mun @@ -1,4 +1,4 @@ struct(value) Vector2 { - x: float, - y: float, + x: f32, + y: f32, } diff --git a/book/listings/ch03-structs/listing11.rs b/book/listings/ch03-structs/listing11.rs index 8ab2c2e3f..e250e4e38 100644 --- a/book/listings/ch03-structs/listing11.rs +++ b/book/listings/ch03-structs/listing11.rs @@ -9,7 +9,7 @@ fn main() { .spawn() .expect("Failed to spawn Runtime"); - let a: StructRef = invoke_fn!(runtime, "vector2_new", -1.0f64, 1.0f64).unwrap(); - let b: StructRef = invoke_fn!(runtime, "vector2_new", 1.0f64, -1.0f64).unwrap(); + let a: StructRef = invoke_fn!(runtime, "vector2_new", -1.0f32, 1.0f32).unwrap(); + let b: StructRef = invoke_fn!(runtime, "vector2_new", 1.0f32, -1.0f32).unwrap(); let added: StructRef = invoke_fn!(runtime, "vector2_add", a, b).unwrap(); } diff --git a/book/listings/ch03-structs/listing12.rs b/book/listings/ch03-structs/listing12.rs index 5e38446ff..4ed358577 100644 --- a/book/listings/ch03-structs/listing12.rs +++ b/book/listings/ch03-structs/listing12.rs @@ -10,8 +10,8 @@ # .spawn() # .expect("Failed to spawn Runtime"); # - let mut xy: StructRef = invoke_fn!(runtime, "vector2_new", -1.0f64, 1.0f64).unwrap(); - let x: f64 = xy.get("x").unwrap(); + let mut xy: StructRef = invoke_fn!(runtime, "vector2_new", -1.0f32, 1.0f32).unwrap(); + let x: f32 = xy.get("x").unwrap(); xy.set("x", x * x).unwrap(); - let y = xy.replace("y", -1.0f64).unwrap(); + let y = xy.replace("y", -1.0f32).unwrap(); # }