From c56d76de65327710d4eb855acf064076efb6cfba Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Thu, 21 Jul 2016 21:50:45 -0400 Subject: [PATCH] We did see namespaces a bit, in ownership with `String::from` --- src/ch05-00-structs.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ch05-00-structs.md b/src/ch05-00-structs.md index 7574d6ca8..23ea61fe3 100644 --- a/src/ch05-00-structs.md +++ b/src/ch05-00-structs.md @@ -74,12 +74,13 @@ f64::powi(2.0, 3) ``` The double colon (`::`) here is a namespace operator. We haven’t talked about -modules yet, but you can think of the `powi()` function as being scoped inside -of another name. In this case, the name is `f64`, the same as the type. The -`powi()` function takes two arguments: the first is a number, and the second is -the power that it raises that number to. In this case, the second number is an -integer, hence the ‘i’ in its name. Similarly, `sqrt()` is a function under the -`f64` module, which takes the square root of its argument. +modules and namespaces in depth yet, but you can think of the `powi()` function +as being scoped inside of another name. In this case, the name is `f64`, the +same as the type. The `powi()` function takes two arguments: the first is a +number, and the second is the power that it raises that number to. In this +case, the second number is an integer, hence the ‘i’ in its name. Similarly, +`sqrt()` is a function under the `f64` module, which takes the square root of +its argument. ## Why `struct`s?