From fea8233606b1b5ccfec2e51f9580b5334ba2edff Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Fri, 30 Sep 2016 15:39:56 +0000 Subject: [PATCH] rebuild pages at 28162bd --- appendix-00.html | 2 +- appendix-01-keywords.html | 2 +- appendix-02-derivable-traits.html | 2 +- ch01-00-introduction.html | 2 +- ch01-01-installation.html | 2 +- ch01-02-hello-world.html | 2 +- ch02-00-guessing-game-tutorial.html | 2 +- ...00-common-programming-concepts-in-rust.html | 2 +- ch03-01-variable-bindings-and-mutability.html | 4 ++-- ch03-02-data-types.html | 2 +- ch03-03-how-functions-work.html | 2 +- ch03-04-comments.html | 2 +- ch03-05-control-flow.html | 4 ++-- ch04-00-understanding-ownership.html | 2 +- ch04-01-ownership.html | 2 +- ch04-02-references-and-borrowing.html | 4 ++-- ch04-03-slices.html | 2 +- ch05-00-structs.html | 4 ++-- ch05-01-method-syntax.html | 4 ++-- ch06-00-enums.html | 2 +- ch06-01-option.html | 2 +- ch06-02-match.html | 2 +- ch06-03-if-let.html | 2 +- ch07-00-modules.html | 2 +- ch07-01-mod-and-the-filesystem.html | 2 +- ch07-02-controlling-visibility-with-pub.html | 2 +- ch07-03-importing-names-with-use.html | 2 +- ch08-00-fundamental-collections.html | 2 +- ch08-01-vectors.html | 4 ++-- ch08-02-strings.html | 4 ++-- ch08-03-hash-maps.html | 4 ++-- chXX-patterns.html | 2 +- chYY-YY-documentation.html | 2 +- chYY-YY-public-api.html | 2 +- chYY-YY-workspaces.html | 2 +- index.html | 2 +- print.html | 18 +++++++++--------- 37 files changed, 53 insertions(+), 53 deletions(-) diff --git a/appendix-00.html b/appendix-00.html index 37c60ed0d..2edbc8454 100644 --- a/appendix-00.html +++ b/appendix-00.html @@ -47,7 +47,7 @@
diff --git a/appendix-01-keywords.html b/appendix-01-keywords.html index 85fae3df6..ca9c1cdb7 100644 --- a/appendix-01-keywords.html +++ b/appendix-01-keywords.html @@ -47,7 +47,7 @@
diff --git a/appendix-02-derivable-traits.html b/appendix-02-derivable-traits.html index bb752ff92..d22c4348d 100644 --- a/appendix-02-derivable-traits.html +++ b/appendix-02-derivable-traits.html @@ -47,7 +47,7 @@
diff --git a/ch01-00-introduction.html b/ch01-00-introduction.html index 598869be6..dfddb59ef 100644 --- a/ch01-00-introduction.html +++ b/ch01-00-introduction.html @@ -47,7 +47,7 @@
diff --git a/ch01-01-installation.html b/ch01-01-installation.html index 8114d6e8d..3beefbd74 100644 --- a/ch01-01-installation.html +++ b/ch01-01-installation.html @@ -47,7 +47,7 @@
diff --git a/ch01-02-hello-world.html b/ch01-02-hello-world.html index d0195d2d9..574d50450 100644 --- a/ch01-02-hello-world.html +++ b/ch01-02-hello-world.html @@ -47,7 +47,7 @@
diff --git a/ch02-00-guessing-game-tutorial.html b/ch02-00-guessing-game-tutorial.html index b09616230..d51ea1398 100644 --- a/ch02-00-guessing-game-tutorial.html +++ b/ch02-00-guessing-game-tutorial.html @@ -47,7 +47,7 @@
diff --git a/ch03-00-common-programming-concepts-in-rust.html b/ch03-00-common-programming-concepts-in-rust.html index 96f03463e..78cedb820 100644 --- a/ch03-00-common-programming-concepts-in-rust.html +++ b/ch03-00-common-programming-concepts-in-rust.html @@ -47,7 +47,7 @@
diff --git a/ch03-01-variable-bindings-and-mutability.html b/ch03-01-variable-bindings-and-mutability.html index 27e40f4b1..a152196a5 100644 --- a/ch03-01-variable-bindings-and-mutability.html +++ b/ch03-01-variable-bindings-and-mutability.html @@ -47,7 +47,7 @@
@@ -132,7 +132,7 @@ fn main(){ hesitate to look up the error code. The compiler is your friend, and it's there to help.

-

The error tells us that the cause of the error is re-assigment of immutable variable, because we tried to assign a second value to the immutable x +

The error tells us that the cause of the error is re-assignment of immutable variable, because we tried to assign a second value to the immutable x variable.

It's important that we get compile-time errors when we attempt to change a value that we previously said was immutable because this very situation can diff --git a/ch03-02-data-types.html b/ch03-02-data-types.html index 1ae453fb8..2bbea170f 100644 --- a/ch03-02-data-types.html +++ b/ch03-02-data-types.html @@ -47,7 +47,7 @@

diff --git a/ch03-03-how-functions-work.html b/ch03-03-how-functions-work.html index 744267a05..3a7aacb6d 100644 --- a/ch03-03-how-functions-work.html +++ b/ch03-03-how-functions-work.html @@ -47,7 +47,7 @@
diff --git a/ch03-04-comments.html b/ch03-04-comments.html index fee6bc174..5a880ce58 100644 --- a/ch03-04-comments.html +++ b/ch03-04-comments.html @@ -47,7 +47,7 @@
diff --git a/ch03-05-control-flow.html b/ch03-05-control-flow.html index 8551433ad..7d7388681 100644 --- a/ch03-05-control-flow.html +++ b/ch03-05-control-flow.html @@ -47,7 +47,7 @@
@@ -248,7 +248,7 @@ error: aborting due to previous error error: Could not compile `branches`. -

The expression in the if block evaluates to an integer and the expresion in +

The expression in the if block evaluates to an integer and the expression in the else block evaluates to a string. This can’t work, because variable bindings must have a single type. Rust needs to know at compile time what type the number binding is, definitively, so that it can verify at compile time diff --git a/ch04-00-understanding-ownership.html b/ch04-00-understanding-ownership.html index 896f8f4e0..b46f4615e 100644 --- a/ch04-00-understanding-ownership.html +++ b/ch04-00-understanding-ownership.html @@ -47,7 +47,7 @@

diff --git a/ch04-01-ownership.html b/ch04-01-ownership.html index 3e9c26454..5292fd3dc 100644 --- a/ch04-01-ownership.html +++ b/ch04-01-ownership.html @@ -47,7 +47,7 @@
diff --git a/ch04-02-references-and-borrowing.html b/ch04-02-references-and-borrowing.html index 87d9e139b..0587349b8 100644 --- a/ch04-02-references-and-borrowing.html +++ b/ch04-02-references-and-borrowing.html @@ -47,7 +47,7 @@
@@ -270,7 +270,7 @@ error: aborting due to previous error lifetimes. We'll discuss lifetimes in detail in Chapter XX, but, disregarding the parts about lifetimes, the message does contain the key to why this code is a problem: this function’s return type contains a borrowed value, but there is no value for it to be borrowed from.

-

Let’s have a closer look at exactly what's happenening at each stage of our +

Let’s have a closer look at exactly what's happening at each stage of our dangle code:

fn dangle() -> &String { // dangle returns a reference to a String
 
diff --git a/ch04-03-slices.html b/ch04-03-slices.html
index 8c218da7f..5419f1d58 100644
--- a/ch04-03-slices.html
+++ b/ch04-03-slices.html
@@ -47,7 +47,7 @@
         
 
         
 
         
diff --git a/ch05-00-structs.html b/ch05-00-structs.html index a323378e2..ff4503151 100644 --- a/ch05-00-structs.html +++ b/ch05-00-structs.html @@ -47,7 +47,7 @@
@@ -269,7 +269,7 @@ code.

Let's try running with this change and... drat. We still get an error:

error: the trait bound `Rectangle: std::fmt::Debug` is not satisfied
 
-

Again, though, the compliler has given us a helpful note!

+

Again, though, the compiler has given us a helpful note!

note: `Rectangle` cannot be formatted using `:?`; if it is defined in your
 crate, add `#[derive(Debug)]` or manually implement it
 
diff --git a/ch05-01-method-syntax.html b/ch05-01-method-syntax.html index ad3369b0a..64125dc03 100644 --- a/ch05-01-method-syntax.html +++ b/ch05-01-method-syntax.html @@ -47,7 +47,7 @@
@@ -195,7 +195,7 @@ would mean we'd need a mutable borrow) and we want main to keep own rect2 so that we could use it again after calling this method. The return value of can_hold will be a boolean, and the implementation will check to see if self's length and width are both greater than the length and width of the -other Rectagle, respectively. Let's write that code!

+other Rectangle, respectively. Let's write that code!

# #[derive(Debug)]
 # struct Rectangle {
 #     length: u32,
diff --git a/ch06-00-enums.html b/ch06-00-enums.html
index e82777e74..ff6e2de0e 100644
--- a/ch06-00-enums.html
+++ b/ch06-00-enums.html
@@ -47,7 +47,7 @@
         
 
         
 
         
diff --git a/ch06-01-option.html b/ch06-01-option.html index 55648bc19..f08601e21 100644 --- a/ch06-01-option.html +++ b/ch06-01-option.html @@ -47,7 +47,7 @@
diff --git a/ch06-02-match.html b/ch06-02-match.html index 12ee8ecbb..4e9d05e37 100644 --- a/ch06-02-match.html +++ b/ch06-02-match.html @@ -47,7 +47,7 @@
diff --git a/ch06-03-if-let.html b/ch06-03-if-let.html index 0e4a26627..00b03ccfb 100644 --- a/ch06-03-if-let.html +++ b/ch06-03-if-let.html @@ -47,7 +47,7 @@
diff --git a/ch07-00-modules.html b/ch07-00-modules.html index da4466598..fdd3af32e 100644 --- a/ch07-00-modules.html +++ b/ch07-00-modules.html @@ -47,7 +47,7 @@
diff --git a/ch07-01-mod-and-the-filesystem.html b/ch07-01-mod-and-the-filesystem.html index b59af770e..892f3fb35 100644 --- a/ch07-01-mod-and-the-filesystem.html +++ b/ch07-01-mod-and-the-filesystem.html @@ -47,7 +47,7 @@
diff --git a/ch07-02-controlling-visibility-with-pub.html b/ch07-02-controlling-visibility-with-pub.html index 5f076f1de..3050266f6 100644 --- a/ch07-02-controlling-visibility-with-pub.html +++ b/ch07-02-controlling-visibility-with-pub.html @@ -47,7 +47,7 @@
diff --git a/ch07-03-importing-names-with-use.html b/ch07-03-importing-names-with-use.html index 32feb1159..3694fbd77 100644 --- a/ch07-03-importing-names-with-use.html +++ b/ch07-03-importing-names-with-use.html @@ -47,7 +47,7 @@
diff --git a/ch08-00-fundamental-collections.html b/ch08-00-fundamental-collections.html index 277e9c8bf..cf9373c1a 100644 --- a/ch08-00-fundamental-collections.html +++ b/ch08-00-fundamental-collections.html @@ -47,7 +47,7 @@
diff --git a/ch08-01-vectors.html b/ch08-01-vectors.html index e222e7683..bf1bbe85e 100644 --- a/ch08-01-vectors.html +++ b/ch08-01-vectors.html @@ -47,7 +47,7 @@
@@ -79,7 +79,7 @@ the values next to each other in memory.

anything with the vector, Rust doesn't know what kind of elements we intend to store. This is an important point. Vectors are homogenous: they may store many values, but those values must all be the same type. Vectors are generic over -the type stored inside them (we'll talk about Generics more throroughly in +the type stored inside them (we'll talk about Generics more thoroughly in Chapter 10), and the angle brackets here tell Rust that this vector will hold elements of the i32 type.

That said, in real code, we very rarely need to do this type annotation since diff --git a/ch08-02-strings.html b/ch08-02-strings.html index b1d7297f3..dd949624c 100644 --- a/ch08-02-strings.html +++ b/ch08-02-strings.html @@ -47,7 +47,7 @@

@@ -164,7 +164,7 @@ though, that come from the type signature of + for Stringadd method that the + operator uses looks something like this:

fn add(self, s: &str) -> String {
 
-

This isn't excatly what the actual signature is in the standard library because +

This isn't exactly what the actual signature is in the standard library because add is defined using generics there. Here, we're just looking at what the signature of the method would be if add was defined specifically for String. This signature gives us the clues we need in order to understand the diff --git a/ch08-03-hash-maps.html b/ch08-03-hash-maps.html index 2d7afec86..2e3438d4c 100644 --- a/ch08-03-hash-maps.html +++ b/ch08-03-hash-maps.html @@ -47,7 +47,7 @@

@@ -70,7 +70,7 @@

Hash Maps

The last of our fundamental collections is the hash map. The type HashMap<K, V> stores a mapping of keys of type K to values of type V. It does this via a hashing function, which determines how it places these keys and values -into memory. Many different programming languges support this kind of data +into memory. Many different programming languages support this kind of data structure, but often with a different name: hash, map, object, hash table, or associative array, just to name a few.

We'll go over the basic API in this chapter, but there are many more goodies diff --git a/chXX-patterns.html b/chXX-patterns.html index 49d0540b9..a69a7dfb9 100644 --- a/chXX-patterns.html +++ b/chXX-patterns.html @@ -47,7 +47,7 @@

diff --git a/chYY-YY-documentation.html b/chYY-YY-documentation.html index b02ae5a64..2bdbbc440 100644 --- a/chYY-YY-documentation.html +++ b/chYY-YY-documentation.html @@ -47,7 +47,7 @@
diff --git a/chYY-YY-public-api.html b/chYY-YY-public-api.html index f16c00940..b64cfe4f3 100644 --- a/chYY-YY-public-api.html +++ b/chYY-YY-public-api.html @@ -47,7 +47,7 @@
diff --git a/chYY-YY-workspaces.html b/chYY-YY-workspaces.html index b8a6db88c..f0c9fd130 100644 --- a/chYY-YY-workspaces.html +++ b/chYY-YY-workspaces.html @@ -47,7 +47,7 @@
diff --git a/index.html b/index.html index e30b53f43..ba1db3bf3 100644 --- a/index.html +++ b/index.html @@ -46,7 +46,7 @@
diff --git a/print.html b/print.html index d981d5087..2bc4189c4 100644 --- a/print.html +++ b/print.html @@ -47,7 +47,7 @@
@@ -1345,7 +1345,7 @@ fn main(){ hesitate to look up the error code. The compiler is your friend, and it's there to help.

-

The error tells us that the cause of the error is re-assigment of immutable variable, because we tried to assign a second value to the immutable x +

The error tells us that the cause of the error is re-assignment of immutable variable, because we tried to assign a second value to the immutable x variable.

It's important that we get compile-time errors when we attempt to change a value that we previously said was immutable because this very situation can @@ -2191,7 +2191,7 @@ error: aborting due to previous error error: Could not compile `branches`.

-

The expression in the if block evaluates to an integer and the expresion in +

The expression in the if block evaluates to an integer and the expression in the else block evaluates to a string. This can’t work, because variable bindings must have a single type. Rust needs to know at compile time what type the number binding is, definitively, so that it can verify at compile time @@ -2970,7 +2970,7 @@ error: aborting due to previous error lifetimes. We'll discuss lifetimes in detail in Chapter XX, but, disregarding the parts about lifetimes, the message does contain the key to why this code is a problem: this function’s return type contains a borrowed value, but there is no value for it to be borrowed from.

-

Let’s have a closer look at exactly what's happenening at each stage of our +

Let’s have a closer look at exactly what's happening at each stage of our dangle code:

fn dangle() -> &String { // dangle returns a reference to a String
 
@@ -3483,7 +3483,7 @@ code.

Let's try running with this change and... drat. We still get an error:

error: the trait bound `Rectangle: std::fmt::Debug` is not satisfied
 
-

Again, though, the compliler has given us a helpful note!

+

Again, though, the compiler has given us a helpful note!

note: `Rectangle` cannot be formatted using `:?`; if it is defined in your
 crate, add `#[derive(Debug)]` or manually implement it
 
@@ -3648,7 +3648,7 @@ would mean we'd need a mutable borrow) and we want main to keep own rect2 so that we could use it again after calling this method. The return value of can_hold will be a boolean, and the implementation will check to see if self's length and width are both greater than the length and width of the -other Rectagle, respectively. Let's write that code!

+other Rectangle, respectively. Let's write that code!

# #[derive(Debug)]
 # struct Rectangle {
 #     length: u32,
@@ -4898,7 +4898,7 @@ the values next to each other in memory.

anything with the vector, Rust doesn't know what kind of elements we intend to store. This is an important point. Vectors are homogenous: they may store many values, but those values must all be the same type. Vectors are generic over -the type stored inside them (we'll talk about Generics more throroughly in +the type stored inside them (we'll talk about Generics more thoroughly in Chapter 10), and the angle brackets here tell Rust that this vector will hold elements of the i32 type.

That said, in real code, we very rarely need to do this type annotation since @@ -5146,7 +5146,7 @@ though, that come from the type signature of + for Stringadd method that the + operator uses looks something like this:

fn add(self, s: &str) -> String {
 
-

This isn't excatly what the actual signature is in the standard library because +

This isn't exactly what the actual signature is in the standard library because add is defined using generics there. Here, we're just looking at what the signature of the method would be if add was defined specifically for String. This signature gives us the clues we need in order to understand the @@ -5313,7 +5313,7 @@ our development lifecycle.

Hash Maps

The last of our fundamental collections is the hash map. The type HashMap<K, V> stores a mapping of keys of type K to values of type V. It does this via a hashing function, which determines how it places these keys and values -into memory. Many different programming languges support this kind of data +into memory. Many different programming languages support this kind of data structure, but often with a different name: hash, map, object, hash table, or associative array, just to name a few.

We'll go over the basic API in this chapter, but there are many more goodies