diff --git a/english/book.toml b/english/book.toml
new file mode 100644
index 0000000..1c1d787
--- /dev/null
+++ b/english/book.toml
@@ -0,0 +1,8 @@
+[book]
+title = "The Rust Programming Language"
+author = "Steve Klabnik and Carol Nichols, with Contributions from the Rust Community"
+
+[output.html]
+additional-css = ["ferris.css", "theme/2018-edition.css"]
+additional-js = ["ferris.js", "language.js"]
+git-repository-url = "https://github.com/rust-lang/book"
diff --git a/english/dot/trpl04-01.dot b/english/dot/trpl04-01.dot
new file mode 100644
index 0000000..331d591
--- /dev/null
+++ b/english/dot/trpl04-01.dot
@@ -0,0 +1,26 @@
+digraph {
+ rankdir=LR;
+ overlap=false;
+ dpi=300.0;
+ node [shape="plaintext"];
+
+ table0[label=<
+ s1 |
+ name | value |
+ ptr | |
+ len | 5 |
+ capacity | 5 |
+
>];
+ table1[label=<
+ index | value |
+ 0 | h |
+ 1 | e |
+ 2 | l |
+ 3 | l |
+ 4 | o |
+
>];
+
+ edge[tailclip="false"];
+ table0:pointer:c -> table1:pointee;
+}
+
diff --git a/english/dot/trpl04-02.dot b/english/dot/trpl04-02.dot
new file mode 100644
index 0000000..e46d2ed
--- /dev/null
+++ b/english/dot/trpl04-02.dot
@@ -0,0 +1,35 @@
+digraph {
+ rankdir=LR;
+ overlap=false;
+ dpi=300.0;
+ node [shape="plaintext"];
+
+ table0[label=<
+ s1 |
+ name | value |
+ ptr | |
+ len | 5 |
+ capacity | 5 |
+
>];
+ table3[label=<
+ s2 |
+ name | value |
+ ptr | |
+ len | 5 |
+ capacity | 5 |
+
>];
+
+ table1[label=<
+ index | value |
+ 0 | h |
+ 1 | e |
+ 2 | l |
+ 3 | l |
+ 4 | o |
+
>];
+
+ edge[tailclip="false"];
+ table0:pointer:c -> table1:pointee;
+ table3:pointer:c -> table1:pointee;
+}
+
diff --git a/english/dot/trpl04-03.dot b/english/dot/trpl04-03.dot
new file mode 100644
index 0000000..16c0b28
--- /dev/null
+++ b/english/dot/trpl04-03.dot
@@ -0,0 +1,44 @@
+digraph {
+ rankdir=LR;
+ overlap=false;
+ dpi=300.0;
+ node [shape="plaintext"];
+
+ table0[label=<
+ s2 |
+ name | value |
+ ptr | |
+ len | 5 |
+ capacity | 5 |
+
>];
+ table1[label=<
+ index | value |
+ 0 | h |
+ 1 | e |
+ 2 | l |
+ 3 | l |
+ 4 | o |
+
>];
+
+ table3[label=<
+ s1 |
+ name | value |
+ ptr | |
+ len | 5 |
+ capacity | 5 |
+
>];
+ table4[label=<
+ index | value |
+ 0 | h |
+ 1 | e |
+ 2 | l |
+ 3 | l |
+ 4 | o |
+
>];
+
+
+ edge[tailclip="false"];
+ table0:pointer:c -> table1:pointee;
+ table3:pointer:c -> table4:pointee;
+}
+
diff --git a/english/dot/trpl04-04.dot b/english/dot/trpl04-04.dot
new file mode 100644
index 0000000..1c95c23
--- /dev/null
+++ b/english/dot/trpl04-04.dot
@@ -0,0 +1,35 @@
+digraph {
+ rankdir=LR;
+ overlap=false;
+ dpi=300.0;
+ node [shape="plaintext"];
+
+ table0[label=<
+ s1 |
+ name | value |
+ ptr | |
+ len | 5 |
+ capacity | 5 |
+
>];
+ table3[label=<
+ s2 |
+ name | value |
+ ptr | |
+ len | 5 |
+ capacity | 5 |
+
>];
+
+ table1[label=<
+ index | value |
+ 0 | h |
+ 1 | e |
+ 2 | l |
+ 3 | l |
+ 4 | o |
+
>];
+
+ edge[tailclip="false"];
+ table0:pointer:c -> table1:pointee;
+ table3:pointer:c -> table1:pointee;
+}
+
diff --git a/english/dot/trpl04-05.dot b/english/dot/trpl04-05.dot
new file mode 100644
index 0000000..ca1f7e0
--- /dev/null
+++ b/english/dot/trpl04-05.dot
@@ -0,0 +1,32 @@
+digraph {
+ rankdir=LR;
+ overlap=false;
+ dpi=300.0;
+ node [shape="plaintext"];
+
+ table0[label=<>];
+ table1[label=<
+ s1 |
+ name | value |
+ ptr | |
+ len | 5 |
+ capacity | 5 |
+
>];
+ table2[label=<
+ index | value |
+ 0 | h |
+ 1 | e |
+ 2 | l |
+ 3 | l |
+ 4 | o |
+
>];
+
+ edge[tailclip="false"];
+ table1:pointer:c -> table2:pointee;
+ table0:borrower:c -> table1:borrowee;
+}
+
diff --git a/english/dot/trpl04-06.dot b/english/dot/trpl04-06.dot
new file mode 100644
index 0000000..a23f179
--- /dev/null
+++ b/english/dot/trpl04-06.dot
@@ -0,0 +1,41 @@
+digraph {
+ rankdir=LR;
+ overlap=false;
+ dpi=300.0;
+ node [shape="plaintext"];
+
+ table0[label=<
+ world |
+ name | value |
+ ptr | |
+ len | 5 |
+
>];
+
+ table3[label=<
+ s |
+ name | value |
+ ptr | |
+ len | 11 |
+ capacity | 11 |
+
>];
+ table4[label=<
+ index | value |
+ 0 | h |
+ 1 | e |
+ 2 | l |
+ 3 | l |
+ 4 | o |
+ 5 | |
+ 6 | w |
+ 7 | o |
+ 8 | r |
+ 9 | l |
+ 10 | d |
+
>];
+
+
+ edge[tailclip="false"];
+ table0:pointer2:c -> table4:pointee2;
+ table3:pointer:c -> table4:pointee;
+}
+
diff --git a/english/dot/trpl15-01.dot b/english/dot/trpl15-01.dot
new file mode 100644
index 0000000..e8b95f9
--- /dev/null
+++ b/english/dot/trpl15-01.dot
@@ -0,0 +1,24 @@
+digraph {
+ rankdir=LR;
+ overlap=false;
+ dpi=300.0;
+ node [shape="plaintext"];
+
+ table0[label=<>];
+}
+
diff --git a/english/dot/trpl15-02.dot b/english/dot/trpl15-02.dot
new file mode 100644
index 0000000..f7dfd22
--- /dev/null
+++ b/english/dot/trpl15-02.dot
@@ -0,0 +1,18 @@
+digraph {
+ rankdir=LR;
+ overlap=false;
+ dpi=300.0;
+ node [shape="plaintext"];
+
+ table0[label=<
+ >];
+}
+
diff --git a/english/dot/trpl15-03.dot b/english/dot/trpl15-03.dot
new file mode 100644
index 0000000..16f0268
--- /dev/null
+++ b/english/dot/trpl15-03.dot
@@ -0,0 +1,51 @@
+digraph {
+ rankdir=LR;
+ overlap=false;
+ dpi=300.0;
+ node [shape="plaintext"];
+
+ table4[label=<>];
+
+ table5[label=<>];
+
+
+ table0[label=<>];
+
+ table1[label=<>];
+
+ table2[label=<>];
+
+ table3[label=<>];
+
+
+ table6[label=<>];
+
+ table7[label=<>];
+
+
+ edge[tailclip="false"];
+ table0:ptr0:c -> table1:pte0;
+ table1:ptr1:c -> table2:pte1;
+ table2:ptr2:c -> table3:pte2;
+ table4:ptr4:c -> table5:pte4;
+ table5:ptr5:c -> table1:pte0;
+ table6:ptr6:c -> table7:pte6;
+ table7:ptr7:c -> table1:pte0;
+}
+
diff --git a/english/dot/trpl15-04.dot b/english/dot/trpl15-04.dot
new file mode 100644
index 0000000..562543c
--- /dev/null
+++ b/english/dot/trpl15-04.dot
@@ -0,0 +1,16 @@
+digraph {
+ node[shape=record];
+ rankdir=LR;
+
+ l1[label="{ 5| }"];
+ l2[label="{ 10| }"];
+
+ {node[shape=point height=0] invisible_start invisible_end}
+
+ a -> l1:n;
+ b -> l2:n;
+ invisible_start:n -> l1[arrowtail=none];
+ invisible_start:s -> invisible_end:s[dir=none];
+ l1:next:c -> l2:data;
+ l2:next:c -> invisible_end:n[arrowhead=none];
+}
diff --git a/english/ferris.css b/english/ferris.css
new file mode 100644
index 0000000..3712079
--- /dev/null
+++ b/english/ferris.css
@@ -0,0 +1,33 @@
+body.light .does_not_compile,
+body.light .panics,
+body.light .not_desired_behavior,
+body.rust .does_not_compile,
+body.rust .panics,
+body.rust .not_desired_behavior {
+ background: #fff1f1;
+}
+
+body.coal .does_not_compile,
+body.coal .panics,
+body.coal .not_desired_behavior,
+body.navy .does_not_compile,
+body.navy .panics,
+body.navy .not_desired_behavior,
+body.ayu .does_not_compile,
+body.ayu .panics,
+body.ayu .not_desired_behavior {
+ background: #501f21;
+}
+
+.ferris {
+ position: absolute;
+ z-index: 99;
+ right: 5px;
+ top: 30px;
+ width: 10%;
+ height: auto;
+}
+
+.ferris-explain {
+ width: 100px;
+}
diff --git a/english/ferris.js b/english/ferris.js
new file mode 100644
index 0000000..5e79b3c
--- /dev/null
+++ b/english/ferris.js
@@ -0,0 +1,51 @@
+var ferrisTypes = [
+ {
+ attr: 'does_not_compile',
+ title: 'This code does not compile!'
+ },
+ {
+ attr: 'panics',
+ title: 'This code panics!'
+ },
+ {
+ attr: 'unsafe',
+ title: 'This code block contains unsafe code.'
+ },
+ {
+ attr: 'not_desired_behavior',
+ title: 'This code does not produce the desired behavior.'
+ }
+]
+
+document.addEventListener('DOMContentLoaded', () => {
+ for (var ferrisType of ferrisTypes) {
+ attachFerrises(ferrisType)
+ }
+})
+
+function attachFerrises (type) {
+ var elements = document.getElementsByClassName(type.attr)
+
+ for (var codeBlock of elements) {
+ var lines = codeBlock.textContent.split(/\r|\r\n|\n/).length - 1;
+
+ if (lines >= 4) {
+ attachFerris(codeBlock, type)
+ }
+ }
+}
+
+function attachFerris (element, type) {
+ var a = document.createElement('a')
+ a.setAttribute('href', 'ch00-00-introduction.html#ferris')
+ a.setAttribute('target', '_blank')
+
+ var img = document.createElement('img')
+ img.setAttribute('src', 'img/ferris/' + type.attr + '.svg')
+ img.setAttribute('title', type.title)
+ img.className = 'ferris'
+
+ a.appendChild(img)
+
+ element.parentElement.insertBefore(a, element)
+}
diff --git a/english/language.js b/english/language.js
new file mode 100644
index 0000000..86a19de
--- /dev/null
+++ b/english/language.js
@@ -0,0 +1,33 @@
+(function () {
+ var url = window.location.href;
+ var host = window.location.host;
+
+ var search = {
+ en: "/en/",
+ zh_CN: "/zh-CN/"
+ }
+
+ var replaceWith = {
+ en: "/zh-CN/",
+ zh_CN: "/en/"
+ }
+
+
+ var link = "";
+ var word = "";
+
+ if (url.indexOf(search.en) != -1 && url.indexOf(search.en) === (url.indexOf(host) + host.length)) {
+ link = url.replace(search.en, replaceWith.en);
+ word = "简体中文";
+ } else if (url.indexOf(search.zh_CN) != -1 && url.indexOf(search.zh_CN) === (url.indexOf(host) + host.length)) {
+ link = url.replace(search.zh_CN, replaceWith.zh_CN);
+ word = "English";
+ }
+
+ var node = ' ' + word + '';
+ var insertNode = document.getElementsByClassName('right-buttons');
+ if (insertNode.length > 0 && link != "") {
+ var html = insertNode[0].innerHTML;
+ insertNode[0].innerHTML = html + node;
+ }
+})()
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.lock b/english/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.lock
new file mode 100644
index 0000000..5802b7d
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "guessing_game"
+version = "0.1.0"
+
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.toml b/english/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.toml
new file mode 100644
index 0000000..e3091e7
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "guessing_game"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs b/english/listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs
new file mode 100644
index 0000000..b822b89
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs
@@ -0,0 +1,31 @@
+// ANCHOR: all
+// ANCHOR: io
+use std::io;
+// ANCHOR_END: io
+
+// ANCHOR: main
+fn main() {
+ // ANCHOR_END: main
+ // ANCHOR: print
+ println!("Guess the number!");
+
+ println!("Please input your guess.");
+ // ANCHOR_END: print
+
+ // ANCHOR: string
+ let mut guess = String::new();
+ // ANCHOR_END: string
+
+ // ANCHOR: read
+ io::stdin()
+ .read_line(&mut guess)
+ // ANCHOR_END: read
+ // ANCHOR: expect
+ .expect("Failed to read line");
+ // ANCHOR_END: expect
+
+ // ANCHOR: print_guess
+ println!("You guessed: {}", guess);
+ // ANCHOR_END: print_guess
+}
+// ANCHOR: all
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock b/english/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock
new file mode 100644
index 0000000..0a2f222
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock
@@ -0,0 +1,83 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "getrandom"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi",
+]
+
+[[package]]
+name = "guessing_game"
+version = "0.1.0"
+dependencies = [
+ "rand",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.86"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c"
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
+
+[[package]]
+name = "rand"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+ "rand_hc",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "rand_hc"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
+dependencies = [
+ "rand_core",
+]
+
+[[package]]
+name = "wasi"
+version = "0.10.2+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.toml b/english/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.toml
new file mode 100644
index 0000000..930a7d9
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.toml
@@ -0,0 +1,10 @@
+[package]
+name = "guessing_game"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+rand = "0.8.3"
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-02/src/main.rs b/english/listings/ch02-guessing-game-tutorial/listing-02-02/src/main.rs
new file mode 100644
index 0000000..60fb2a8
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-02/src/main.rs
@@ -0,0 +1,15 @@
+use std::io;
+
+fn main() {
+ println!("Guess the number!");
+
+ println!("Please input your guess.");
+
+ let mut guess = String::new();
+
+ io::stdin()
+ .read_line(&mut guess)
+ .expect("Failed to read line");
+
+ println!("You guessed: {}", guess);
+}
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.lock b/english/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.lock
new file mode 100644
index 0000000..0a2f222
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.lock
@@ -0,0 +1,83 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "getrandom"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi",
+]
+
+[[package]]
+name = "guessing_game"
+version = "0.1.0"
+dependencies = [
+ "rand",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.86"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c"
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
+
+[[package]]
+name = "rand"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+ "rand_hc",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "rand_hc"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
+dependencies = [
+ "rand_core",
+]
+
+[[package]]
+name = "wasi"
+version = "0.10.2+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.toml b/english/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.toml
new file mode 100644
index 0000000..930a7d9
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.toml
@@ -0,0 +1,10 @@
+[package]
+name = "guessing_game"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+rand = "0.8.3"
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs b/english/listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs
new file mode 100644
index 0000000..de35846
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs
@@ -0,0 +1,28 @@
+// ANCHOR: all
+use std::io;
+// ANCHOR: ch07-04
+use rand::Rng;
+
+fn main() {
+ // ANCHOR_END: ch07-04
+ println!("Guess the number!");
+
+ // ANCHOR: ch07-04
+ let secret_number = rand::thread_rng().gen_range(1..101);
+ // ANCHOR_END: ch07-04
+
+ println!("The secret number is: {}", secret_number);
+
+ println!("Please input your guess.");
+
+ let mut guess = String::new();
+
+ io::stdin()
+ .read_line(&mut guess)
+ .expect("Failed to read line");
+
+ println!("You guessed: {}", guess);
+ // ANCHOR: ch07-04
+}
+// ANCHOR_END: ch07-04
+// ANCHOR_END: all
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.lock b/english/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.lock
new file mode 100644
index 0000000..0a2f222
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.lock
@@ -0,0 +1,83 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "getrandom"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi",
+]
+
+[[package]]
+name = "guessing_game"
+version = "0.1.0"
+dependencies = [
+ "rand",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.86"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c"
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
+
+[[package]]
+name = "rand"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+ "rand_hc",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "rand_hc"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
+dependencies = [
+ "rand_core",
+]
+
+[[package]]
+name = "wasi"
+version = "0.10.2+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.toml b/english/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.toml
new file mode 100644
index 0000000..930a7d9
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.toml
@@ -0,0 +1,10 @@
+[package]
+name = "guessing_game"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+rand = "0.8.3"
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt b/english/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt
new file mode 100644
index 0000000..6ee46be
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt
@@ -0,0 +1,24 @@
+$ cargo build
+ Compiling libc v0.2.86
+ Compiling getrandom v0.2.2
+ Compiling cfg-if v1.0.0
+ Compiling ppv-lite86 v0.2.10
+ Compiling rand_core v0.6.2
+ Compiling rand_chacha v0.3.0
+ Compiling rand v0.8.3
+ Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
+error[E0308]: mismatched types
+ --> src/main.rs:22:21
+ |
+22 | match guess.cmp(&secret_number) {
+ | ^^^^^^^^^^^^^^ expected struct `String`, found integer
+ |
+ = note: expected reference `&String`
+ found reference `&{integer}`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
+error: could not compile `guessing_game`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-04/src/main.rs b/english/listings/ch02-guessing-game-tutorial/listing-02-04/src/main.rs
new file mode 100644
index 0000000..349bc27
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-04/src/main.rs
@@ -0,0 +1,32 @@
+// ANCHOR: here
+use rand::Rng;
+use std::cmp::Ordering;
+use std::io;
+
+fn main() {
+ // --snip--
+ // ANCHOR_END: here
+ println!("Guess the number!");
+
+ let secret_number = rand::thread_rng().gen_range(1..101);
+
+ println!("The secret number is: {}", secret_number);
+
+ println!("Please input your guess.");
+
+ let mut guess = String::new();
+
+ io::stdin()
+ .read_line(&mut guess)
+ .expect("Failed to read line");
+ // ANCHOR: here
+
+ println!("You guessed: {}", guess);
+
+ match guess.cmp(&secret_number) {
+ Ordering::Less => println!("Too small!"),
+ Ordering::Greater => println!("Too big!"),
+ Ordering::Equal => println!("You win!"),
+ }
+}
+// ANCHOR_END: here
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.lock b/english/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.lock
new file mode 100644
index 0000000..0a2f222
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.lock
@@ -0,0 +1,83 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "getrandom"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi",
+]
+
+[[package]]
+name = "guessing_game"
+version = "0.1.0"
+dependencies = [
+ "rand",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.86"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c"
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
+
+[[package]]
+name = "rand"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+ "rand_hc",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "rand_hc"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
+dependencies = [
+ "rand_core",
+]
+
+[[package]]
+name = "wasi"
+version = "0.10.2+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.toml b/english/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.toml
new file mode 100644
index 0000000..930a7d9
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.toml
@@ -0,0 +1,10 @@
+[package]
+name = "guessing_game"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+rand = "0.8.3"
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-05/src/main.rs b/english/listings/ch02-guessing-game-tutorial/listing-02-05/src/main.rs
new file mode 100644
index 0000000..41a4cdd
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-05/src/main.rs
@@ -0,0 +1,45 @@
+use rand::Rng;
+use std::cmp::Ordering;
+use std::io;
+
+fn main() {
+ println!("Guess the number!");
+
+ let secret_number = rand::thread_rng().gen_range(1..101);
+
+ println!("The secret number is: {}", secret_number);
+
+ loop {
+ println!("Please input your guess.");
+
+ let mut guess = String::new();
+
+ // ANCHOR: here
+ // --snip--
+
+ io::stdin()
+ .read_line(&mut guess)
+ .expect("Failed to read line");
+
+ // ANCHOR: ch19
+ let guess: u32 = match guess.trim().parse() {
+ Ok(num) => num,
+ Err(_) => continue,
+ };
+ // ANCHOR_END: ch19
+
+ println!("You guessed: {}", guess);
+
+ // --snip--
+ // ANCHOR_END: here
+
+ match guess.cmp(&secret_number) {
+ Ordering::Less => println!("Too small!"),
+ Ordering::Greater => println!("Too big!"),
+ Ordering::Equal => {
+ println!("You win!");
+ break;
+ }
+ }
+ }
+}
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.lock b/english/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.lock
new file mode 100644
index 0000000..0a2f222
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.lock
@@ -0,0 +1,83 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "getrandom"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi",
+]
+
+[[package]]
+name = "guessing_game"
+version = "0.1.0"
+dependencies = [
+ "rand",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.86"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c"
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
+
+[[package]]
+name = "rand"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+ "rand_hc",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "rand_hc"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
+dependencies = [
+ "rand_core",
+]
+
+[[package]]
+name = "wasi"
+version = "0.10.2+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.toml b/english/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.toml
new file mode 100644
index 0000000..930a7d9
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.toml
@@ -0,0 +1,10 @@
+[package]
+name = "guessing_game"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+rand = "0.8.3"
diff --git a/english/listings/ch02-guessing-game-tutorial/listing-02-06/src/main.rs b/english/listings/ch02-guessing-game-tutorial/listing-02-06/src/main.rs
new file mode 100644
index 0000000..30859c7
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/listing-02-06/src/main.rs
@@ -0,0 +1,35 @@
+use rand::Rng;
+use std::cmp::Ordering;
+use std::io;
+
+fn main() {
+ println!("Guess the number!");
+
+ let secret_number = rand::thread_rng().gen_range(1..101);
+
+ loop {
+ println!("Please input your guess.");
+
+ let mut guess = String::new();
+
+ io::stdin()
+ .read_line(&mut guess)
+ .expect("Failed to read line");
+
+ let guess: u32 = match guess.trim().parse() {
+ Ok(num) => num,
+ Err(_) => continue,
+ };
+
+ println!("You guessed: {}", guess);
+
+ match guess.cmp(&secret_number) {
+ Ordering::Less => println!("Too small!"),
+ Ordering::Greater => println!("Too big!"),
+ Ordering::Equal => {
+ println!("You win!");
+ break;
+ }
+ }
+ }
+}
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.lock b/english/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.lock
new file mode 100644
index 0000000..5802b7d
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "guessing_game"
+version = "0.1.0"
+
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.toml b/english/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.toml
new file mode 100644
index 0000000..e3091e7
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "guessing_game"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/output.txt b/english/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/output.txt
new file mode 100644
index 0000000..2724c14
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/output.txt
@@ -0,0 +1,5 @@
+$ cargo run
+ Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
+ Finished dev [unoptimized + debuginfo] target(s) in 1.50s
+ Running `target/debug/guessing_game`
+Hello, world!
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/src/main.rs b/english/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/src/main.rs
new file mode 100644
index 0000000..e7a11a9
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ println!("Hello, world!");
+}
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.lock b/english/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.lock
new file mode 100644
index 0000000..5802b7d
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "guessing_game"
+version = "0.1.0"
+
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.toml b/english/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.toml
new file mode 100644
index 0000000..e3091e7
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "guessing_game"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/output.txt b/english/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/output.txt
new file mode 100644
index 0000000..c56c889
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/output.txt
@@ -0,0 +1,14 @@
+$ cargo build
+ Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
+warning: unused `Result` that must be used
+ --> src/main.rs:10:5
+ |
+10 | io::stdin().read_line(&mut guess);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(unused_must_use)]` on by default
+ = note: this `Result` may be an `Err` variant, which should be handled
+
+warning: 1 warning emitted
+
+ Finished dev [unoptimized + debuginfo] target(s) in 0.59s
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/src/main.rs b/english/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/src/main.rs
new file mode 100644
index 0000000..aaf90bd
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/src/main.rs
@@ -0,0 +1,13 @@
+use std::io;
+
+fn main() {
+ println!("Guess the number!");
+
+ println!("Please input your guess.");
+
+ let mut guess = String::new();
+
+ io::stdin().read_line(&mut guess);
+
+ println!("You guessed: {}", guess);
+}
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.lock b/english/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.lock
new file mode 100644
index 0000000..0a2f222
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.lock
@@ -0,0 +1,83 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "getrandom"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi",
+]
+
+[[package]]
+name = "guessing_game"
+version = "0.1.0"
+dependencies = [
+ "rand",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.86"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c"
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
+
+[[package]]
+name = "rand"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+ "rand_hc",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "rand_hc"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
+dependencies = [
+ "rand_core",
+]
+
+[[package]]
+name = "wasi"
+version = "0.10.2+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.toml b/english/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.toml
new file mode 100644
index 0000000..930a7d9
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.toml
@@ -0,0 +1,10 @@
+[package]
+name = "guessing_game"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+rand = "0.8.3"
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/src/main.rs b/english/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/src/main.rs
new file mode 100644
index 0000000..0b21d95
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/src/main.rs
@@ -0,0 +1,33 @@
+use rand::Rng;
+use std::cmp::Ordering;
+use std::io;
+
+fn main() {
+ println!("Guess the number!");
+
+ let secret_number = rand::thread_rng().gen_range(1..101);
+
+ println!("The secret number is: {}", secret_number);
+
+ println!("Please input your guess.");
+
+ // ANCHOR: here
+ // --snip--
+
+ let mut guess = String::new();
+
+ io::stdin()
+ .read_line(&mut guess)
+ .expect("Failed to read line");
+
+ let guess: u32 = guess.trim().parse().expect("Please type a number!");
+
+ println!("You guessed: {}", guess);
+
+ match guess.cmp(&secret_number) {
+ Ordering::Less => println!("Too small!"),
+ Ordering::Greater => println!("Too big!"),
+ Ordering::Equal => println!("You win!"),
+ }
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.lock b/english/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.lock
new file mode 100644
index 0000000..0a2f222
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.lock
@@ -0,0 +1,83 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "getrandom"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi",
+]
+
+[[package]]
+name = "guessing_game"
+version = "0.1.0"
+dependencies = [
+ "rand",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.86"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c"
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
+
+[[package]]
+name = "rand"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+ "rand_hc",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "rand_hc"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
+dependencies = [
+ "rand_core",
+]
+
+[[package]]
+name = "wasi"
+version = "0.10.2+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.toml b/english/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.toml
new file mode 100644
index 0000000..930a7d9
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.toml
@@ -0,0 +1,10 @@
+[package]
+name = "guessing_game"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+rand = "0.8.3"
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-04-looping/src/main.rs b/english/listings/ch02-guessing-game-tutorial/no-listing-04-looping/src/main.rs
new file mode 100644
index 0000000..61a5dc0
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-04-looping/src/main.rs
@@ -0,0 +1,40 @@
+use rand::Rng;
+use std::cmp::Ordering;
+use std::io;
+
+fn main() {
+ println!("Guess the number!");
+
+ let secret_number = rand::thread_rng().gen_range(1..101);
+
+ // ANCHOR: here
+ // --snip--
+
+ println!("The secret number is: {}", secret_number);
+
+ loop {
+ println!("Please input your guess.");
+
+ // --snip--
+
+ // ANCHOR_END: here
+
+ let mut guess = String::new();
+
+ io::stdin()
+ .read_line(&mut guess)
+ .expect("Failed to read line");
+
+ let guess: u32 = guess.trim().parse().expect("Please type a number!");
+
+ println!("You guessed: {}", guess);
+
+ // ANCHOR: here
+ match guess.cmp(&secret_number) {
+ Ordering::Less => println!("Too small!"),
+ Ordering::Greater => println!("Too big!"),
+ Ordering::Equal => println!("You win!"),
+ }
+ }
+}
+// ANCHOR_END: here
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.lock b/english/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.lock
new file mode 100644
index 0000000..0a2f222
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.lock
@@ -0,0 +1,83 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "getrandom"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi",
+]
+
+[[package]]
+name = "guessing_game"
+version = "0.1.0"
+dependencies = [
+ "rand",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.86"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c"
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
+
+[[package]]
+name = "rand"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+ "rand_hc",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "rand_hc"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
+dependencies = [
+ "rand_core",
+]
+
+[[package]]
+name = "wasi"
+version = "0.10.2+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.toml b/english/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.toml
new file mode 100644
index 0000000..930a7d9
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.toml
@@ -0,0 +1,10 @@
+[package]
+name = "guessing_game"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+rand = "0.8.3"
diff --git a/english/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/src/main.rs b/english/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/src/main.rs
new file mode 100644
index 0000000..3f8e8b7
--- /dev/null
+++ b/english/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/src/main.rs
@@ -0,0 +1,38 @@
+use rand::Rng;
+use std::cmp::Ordering;
+use std::io;
+
+fn main() {
+ println!("Guess the number!");
+
+ let secret_number = rand::thread_rng().gen_range(1..101);
+
+ println!("The secret number is: {}", secret_number);
+
+ loop {
+ println!("Please input your guess.");
+
+ let mut guess = String::new();
+
+ io::stdin()
+ .read_line(&mut guess)
+ .expect("Failed to read line");
+
+ let guess: u32 = guess.trim().parse().expect("Please type a number!");
+
+ println!("You guessed: {}", guess);
+
+ // ANCHOR: here
+ // --snip--
+
+ match guess.cmp(&secret_number) {
+ Ordering::Less => println!("Too small!"),
+ Ordering::Greater => println!("Too big!"),
+ Ordering::Equal => {
+ println!("You win!");
+ break;
+ }
+ }
+ }
+}
+// ANCHOR_END: here
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-01/Cargo.lock b/english/listings/ch03-common-programming-concepts/listing-03-01/Cargo.lock
new file mode 100644
index 0000000..88287d1
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-01/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "functions"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-01/Cargo.toml b/english/listings/ch03-common-programming-concepts/listing-03-01/Cargo.toml
new file mode 100644
index 0000000..291680c
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-01/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "functions"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-01/src/main.rs b/english/listings/ch03-common-programming-concepts/listing-03-01/src/main.rs
new file mode 100644
index 0000000..b492d38
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-01/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ let y = 6;
+}
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-02/Cargo.lock b/english/listings/ch03-common-programming-concepts/listing-03-02/Cargo.lock
new file mode 100644
index 0000000..4ca0c2d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-02/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "branches"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-02/Cargo.toml b/english/listings/ch03-common-programming-concepts/listing-03-02/Cargo.toml
new file mode 100644
index 0000000..8ddf691
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-02/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "branches"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-02/output.txt b/english/listings/ch03-common-programming-concepts/listing-03-02/output.txt
new file mode 100644
index 0000000..3eb8d10
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-02/output.txt
@@ -0,0 +1,5 @@
+$ cargo run
+ Compiling branches v0.1.0 (file:///projects/branches)
+ Finished dev [unoptimized + debuginfo] target(s) in 0.30s
+ Running `target/debug/branches`
+The value of number is: 5
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-02/src/main.rs b/english/listings/ch03-common-programming-concepts/listing-03-02/src/main.rs
new file mode 100644
index 0000000..0b8ee95
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-02/src/main.rs
@@ -0,0 +1,6 @@
+fn main() {
+ let condition = true;
+ let number = if condition { 5 } else { 6 };
+
+ println!("The value of number is: {}", number);
+}
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-03/Cargo.lock b/english/listings/ch03-common-programming-concepts/listing-03-03/Cargo.lock
new file mode 100644
index 0000000..9942b36
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-03/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "loops"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-03/Cargo.toml b/english/listings/ch03-common-programming-concepts/listing-03-03/Cargo.toml
new file mode 100644
index 0000000..b5ed848
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-03/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "loops"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-03/src/main.rs b/english/listings/ch03-common-programming-concepts/listing-03-03/src/main.rs
new file mode 100644
index 0000000..651ed68
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-03/src/main.rs
@@ -0,0 +1,11 @@
+fn main() {
+ let mut number = 3;
+
+ while number != 0 {
+ println!("{}!", number);
+
+ number -= 1;
+ }
+
+ println!("LIFTOFF!!!");
+}
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-04/Cargo.lock b/english/listings/ch03-common-programming-concepts/listing-03-04/Cargo.lock
new file mode 100644
index 0000000..9942b36
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-04/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "loops"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-04/Cargo.toml b/english/listings/ch03-common-programming-concepts/listing-03-04/Cargo.toml
new file mode 100644
index 0000000..b5ed848
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-04/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "loops"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-04/output.txt b/english/listings/ch03-common-programming-concepts/listing-03-04/output.txt
new file mode 100644
index 0000000..35c0f80
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-04/output.txt
@@ -0,0 +1,9 @@
+$ cargo run
+ Compiling loops v0.1.0 (file:///projects/loops)
+ Finished dev [unoptimized + debuginfo] target(s) in 0.32s
+ Running `target/debug/loops`
+the value is: 10
+the value is: 20
+the value is: 30
+the value is: 40
+the value is: 50
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-04/src/main.rs b/english/listings/ch03-common-programming-concepts/listing-03-04/src/main.rs
new file mode 100644
index 0000000..38fd301
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-04/src/main.rs
@@ -0,0 +1,10 @@
+fn main() {
+ let a = [10, 20, 30, 40, 50];
+ let mut index = 0;
+
+ while index < 5 {
+ println!("the value is: {}", a[index]);
+
+ index += 1;
+ }
+}
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-05/Cargo.lock b/english/listings/ch03-common-programming-concepts/listing-03-05/Cargo.lock
new file mode 100644
index 0000000..9942b36
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-05/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "loops"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-05/Cargo.toml b/english/listings/ch03-common-programming-concepts/listing-03-05/Cargo.toml
new file mode 100644
index 0000000..b5ed848
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-05/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "loops"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/listing-03-05/src/main.rs b/english/listings/ch03-common-programming-concepts/listing-03-05/src/main.rs
new file mode 100644
index 0000000..6e3cca6
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/listing-03-05/src/main.rs
@@ -0,0 +1,7 @@
+fn main() {
+ let a = [10, 20, 30, 40, 50];
+
+ for element in a.iter() {
+ println!("the value is: {}", element);
+ }
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.lock
new file mode 100644
index 0000000..2d62cbe
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "variables"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.toml
new file mode 100644
index 0000000..7915d39
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "variables"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt
new file mode 100644
index 0000000..7c2ec5b
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt
@@ -0,0 +1,20 @@
+$ cargo run
+ Compiling variables v0.1.0 (file:///projects/variables)
+error[E0384]: cannot assign twice to immutable variable `x`
+ --> src/main.rs:4:5
+ |
+2 | let x = 5;
+ | -
+ | |
+ | first assignment to `x`
+ | help: make this binding mutable: `mut x`
+3 | println!("The value of x is: {}", x);
+4 | x = 6;
+ | ^^^^^ cannot assign twice to immutable variable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0384`.
+error: could not compile `variables`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/src/main.rs
new file mode 100644
index 0000000..a6c7ac0
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/src/main.rs
@@ -0,0 +1,6 @@
+fn main() {
+ let x = 5;
+ println!("The value of x is: {}", x);
+ x = 6;
+ println!("The value of x is: {}", x);
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.lock
new file mode 100644
index 0000000..2d62cbe
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "variables"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.toml
new file mode 100644
index 0000000..7915d39
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "variables"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/output.txt
new file mode 100644
index 0000000..8ed6598
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/output.txt
@@ -0,0 +1,6 @@
+$ cargo run
+ Compiling variables v0.1.0 (file:///projects/variables)
+ Finished dev [unoptimized + debuginfo] target(s) in 0.30s
+ Running `target/debug/variables`
+The value of x is: 5
+The value of x is: 6
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/src/main.rs
new file mode 100644
index 0000000..c4e4a19
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/src/main.rs
@@ -0,0 +1,6 @@
+fn main() {
+ let mut x = 5;
+ println!("The value of x is: {}", x);
+ x = 6;
+ println!("The value of x is: {}", x);
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.lock
new file mode 100644
index 0000000..2d62cbe
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "variables"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.toml
new file mode 100644
index 0000000..7915d39
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "variables"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-03-shadowing/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-03-shadowing/output.txt
new file mode 100644
index 0000000..64ac2bf
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-03-shadowing/output.txt
@@ -0,0 +1,5 @@
+$ cargo run
+ Compiling variables v0.1.0 (file:///projects/variables)
+ Finished dev [unoptimized + debuginfo] target(s) in 0.31s
+ Running `target/debug/variables`
+The value of x is: 12
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-03-shadowing/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-03-shadowing/src/main.rs
new file mode 100644
index 0000000..d325180
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-03-shadowing/src/main.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let x = 5;
+
+ let x = x + 1;
+
+ let x = x * 2;
+
+ println!("The value of x is: {}", x);
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.lock
new file mode 100644
index 0000000..2d62cbe
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "variables"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.toml
new file mode 100644
index 0000000..7915d39
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "variables"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/src/main.rs
new file mode 100644
index 0000000..42589f5
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/src/main.rs
@@ -0,0 +1,6 @@
+fn main() {
+ // ANCHOR: here
+ let spaces = " ";
+ let spaces = spaces.len();
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.lock
new file mode 100644
index 0000000..2d62cbe
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "variables"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.toml
new file mode 100644
index 0000000..7915d39
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "variables"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/output.txt
new file mode 100644
index 0000000..166b079
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/output.txt
@@ -0,0 +1,14 @@
+$ cargo run
+ Compiling variables v0.1.0 (file:///projects/variables)
+error[E0308]: mismatched types
+ --> src/main.rs:3:14
+ |
+3 | spaces = spaces.len();
+ | ^^^^^^^^^^^^ expected `&str`, found `usize`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
+error: could not compile `variables`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/src/main.rs
new file mode 100644
index 0000000..f52635d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/src/main.rs
@@ -0,0 +1,6 @@
+fn main() {
+ // ANCHOR: here
+ let mut spaces = " ";
+ spaces = spaces.len();
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.lock
new file mode 100644
index 0000000..3b40559
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "floating-point"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.toml
new file mode 100644
index 0000000..81e80c2
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "floating-point"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-06-floating-point/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-06-floating-point/src/main.rs
new file mode 100644
index 0000000..6f4f0fe
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-06-floating-point/src/main.rs
@@ -0,0 +1,5 @@
+fn main() {
+ let x = 2.0; // f64
+
+ let y: f32 = 3.0; // f32
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.lock
new file mode 100644
index 0000000..94a12b2
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "numeric-operations"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.toml
new file mode 100644
index 0000000..00601dd
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "numeric-operations"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/src/main.rs
new file mode 100644
index 0000000..0a784bb
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/src/main.rs
@@ -0,0 +1,16 @@
+fn main() {
+ // addition
+ let sum = 5 + 10;
+
+ // subtraction
+ let difference = 95.5 - 4.3;
+
+ // multiplication
+ let product = 4 * 30;
+
+ // division
+ let quotient = 56.7 / 32.2;
+
+ // remainder
+ let remainder = 43 % 5;
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.lock
new file mode 100644
index 0000000..5d5728e
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "boolean"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.toml
new file mode 100644
index 0000000..783df3d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "boolean"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-08-boolean/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-08-boolean/src/main.rs
new file mode 100644
index 0000000..2c56e62
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-08-boolean/src/main.rs
@@ -0,0 +1,5 @@
+fn main() {
+ let t = true;
+
+ let f: bool = false; // with explicit type annotation
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.lock
new file mode 100644
index 0000000..bb58446
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "char"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.toml
new file mode 100644
index 0000000..cfde83b
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "char"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-09-char/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-09-char/src/main.rs
new file mode 100644
index 0000000..4b8d9d9
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-09-char/src/main.rs
@@ -0,0 +1,5 @@
+fn main() {
+ let c = 'z';
+ let z = 'ℤ';
+ let heart_eyed_cat = '😻';
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.lock
new file mode 100644
index 0000000..f57f076
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "tuples"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.toml
new file mode 100644
index 0000000..8d6c2d5
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "tuples"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-10-tuples/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-10-tuples/src/main.rs
new file mode 100644
index 0000000..b7b51fb
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-10-tuples/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ let tup: (i32, f64, u8) = (500, 6.4, 1);
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.lock
new file mode 100644
index 0000000..f57f076
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "tuples"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.toml
new file mode 100644
index 0000000..8d6c2d5
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "tuples"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/src/main.rs
new file mode 100644
index 0000000..35dcb44
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/src/main.rs
@@ -0,0 +1,7 @@
+fn main() {
+ let tup = (500, 6.4, 1);
+
+ let (x, y, z) = tup;
+
+ println!("The value of y is: {}", y);
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.lock
new file mode 100644
index 0000000..f57f076
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "tuples"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.toml
new file mode 100644
index 0000000..8d6c2d5
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "tuples"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/src/main.rs
new file mode 100644
index 0000000..1b1e646
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/src/main.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let x: (i32, f64, u8) = (500, 6.4, 1);
+
+ let five_hundred = x.0;
+
+ let six_point_four = x.1;
+
+ let one = x.2;
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.lock
new file mode 100644
index 0000000..68e3c59
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "arrays"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.toml
new file mode 100644
index 0000000..ec97b7d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "arrays"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-13-arrays/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-13-arrays/src/main.rs
new file mode 100644
index 0000000..d475901
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-13-arrays/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ let a = [1, 2, 3, 4, 5];
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.lock
new file mode 100644
index 0000000..68e3c59
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "arrays"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.toml
new file mode 100644
index 0000000..ec97b7d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "arrays"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/src/main.rs
new file mode 100644
index 0000000..d33e317
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/src/main.rs
@@ -0,0 +1,6 @@
+fn main() {
+ let a = [1, 2, 3, 4, 5];
+
+ let first = a[0];
+ let second = a[1];
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.lock
new file mode 100644
index 0000000..68e3c59
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "arrays"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.toml
new file mode 100644
index 0000000..ec97b7d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "arrays"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/src/main.rs
new file mode 100644
index 0000000..5e51216
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/src/main.rs
@@ -0,0 +1,25 @@
+use std::io;
+
+fn main() {
+ let a = [1, 2, 3, 4, 5];
+
+ println!("Please enter an array index.");
+
+ let mut index = String::new();
+
+ io::stdin()
+ .read_line(&mut index)
+ .expect("Failed to read line");
+
+ let index: usize = index
+ .trim()
+ .parse()
+ .expect("Index entered was not a number");
+
+ let element = a[index];
+
+ println!(
+ "The value of the element at index {} is: {}",
+ index, element
+ );
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.lock
new file mode 100644
index 0000000..88287d1
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "functions"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.toml
new file mode 100644
index 0000000..291680c
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "functions"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-16-functions/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-16-functions/output.txt
new file mode 100644
index 0000000..723fad3
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-16-functions/output.txt
@@ -0,0 +1,6 @@
+$ cargo run
+ Compiling functions v0.1.0 (file:///projects/functions)
+ Finished dev [unoptimized + debuginfo] target(s) in 0.28s
+ Running `target/debug/functions`
+Hello, world!
+Another function.
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-16-functions/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-16-functions/src/main.rs
new file mode 100644
index 0000000..38be856
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-16-functions/src/main.rs
@@ -0,0 +1,9 @@
+fn main() {
+ println!("Hello, world!");
+
+ another_function();
+}
+
+fn another_function() {
+ println!("Another function.");
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.lock
new file mode 100644
index 0000000..88287d1
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "functions"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.toml
new file mode 100644
index 0000000..291680c
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "functions"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/output.txt
new file mode 100644
index 0000000..546bbc0
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/output.txt
@@ -0,0 +1,5 @@
+$ cargo run
+ Compiling functions v0.1.0 (file:///projects/functions)
+ Finished dev [unoptimized + debuginfo] target(s) in 1.21s
+ Running `target/debug/functions`
+The value of x is: 5
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/src/main.rs
new file mode 100644
index 0000000..029446c
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/src/main.rs
@@ -0,0 +1,7 @@
+fn main() {
+ another_function(5);
+}
+
+fn another_function(x: i32) {
+ println!("The value of x is: {}", x);
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.lock
new file mode 100644
index 0000000..88287d1
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "functions"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.toml
new file mode 100644
index 0000000..291680c
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "functions"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/output.txt
new file mode 100644
index 0000000..d651191
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/output.txt
@@ -0,0 +1,6 @@
+$ cargo run
+ Compiling functions v0.1.0 (file:///projects/functions)
+ Finished dev [unoptimized + debuginfo] target(s) in 0.31s
+ Running `target/debug/functions`
+The value of x is: 5
+The value of y is: 6
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/src/main.rs
new file mode 100644
index 0000000..fe476db
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/src/main.rs
@@ -0,0 +1,8 @@
+fn main() {
+ another_function(5, 6);
+}
+
+fn another_function(x: i32, y: i32) {
+ println!("The value of x is: {}", x);
+ println!("The value of y is: {}", y);
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.lock
new file mode 100644
index 0000000..89a654d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.lock
@@ -0,0 +1,4 @@
+[[package]]
+name = "functions"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.toml
new file mode 100644
index 0000000..291680c
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "functions"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/output.txt
new file mode 100644
index 0000000..7409e85
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/output.txt
@@ -0,0 +1,33 @@
+$ cargo run
+ Compiling functions v0.1.0 (file:///projects/functions)
+error[E0658]: `let` expressions in this position are experimental
+ --> src/main.rs:2:14
+ |
+2 | let x = (let y = 6);
+ | ^^^^^^^^^
+ |
+ = note: see issue #53667 for more information
+ = help: you can write `matches!(, )` instead of `let = `
+
+error: expected expression, found statement (`let`)
+ --> src/main.rs:2:14
+ |
+2 | let x = (let y = 6);
+ | ^^^^^^^^^
+ |
+ = note: variable declaration using `let` is a statement
+
+warning: unnecessary parentheses around assigned value
+ --> src/main.rs:2:13
+ |
+2 | let x = (let y = 6);
+ | ^^^^^^^^^^^ help: remove these parentheses
+ |
+ = note: `#[warn(unused_parens)]` on by default
+
+error: aborting due to 2 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0658`.
+error: could not compile `functions`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/rustfmt-ignore b/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/rustfmt-ignore
new file mode 100644
index 0000000..06a976d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/rustfmt-ignore
@@ -0,0 +1 @@
+This listing deliberately doesn't parse so rustfmt fails.
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/src/main.rs
new file mode 100644
index 0000000..988f965
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ let x = (let y = 6);
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.lock
new file mode 100644
index 0000000..88287d1
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "functions"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.toml
new file mode 100644
index 0000000..291680c
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "functions"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/src/main.rs
new file mode 100644
index 0000000..baa853e
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/src/main.rs
@@ -0,0 +1,10 @@
+fn main() {
+ let x = 5;
+
+ let y = {
+ let x = 3;
+ x + 1
+ };
+
+ println!("The value of y is: {}", y);
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.lock
new file mode 100644
index 0000000..88287d1
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "functions"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.toml
new file mode 100644
index 0000000..291680c
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "functions"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/output.txt
new file mode 100644
index 0000000..a457e33
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/output.txt
@@ -0,0 +1,5 @@
+$ cargo run
+ Compiling functions v0.1.0 (file:///projects/functions)
+ Finished dev [unoptimized + debuginfo] target(s) in 0.30s
+ Running `target/debug/functions`
+The value of x is: 5
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/src/main.rs
new file mode 100644
index 0000000..5303b10
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/src/main.rs
@@ -0,0 +1,9 @@
+fn five() -> i32 {
+ 5
+}
+
+fn main() {
+ let x = five();
+
+ println!("The value of x is: {}", x);
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.lock
new file mode 100644
index 0000000..88287d1
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "functions"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.toml
new file mode 100644
index 0000000..291680c
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "functions"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/src/main.rs
new file mode 100644
index 0000000..b4c8443
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/src/main.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let x = plus_one(5);
+
+ println!("The value of x is: {}", x);
+}
+
+fn plus_one(x: i32) -> i32 {
+ x + 1
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.lock
new file mode 100644
index 0000000..88287d1
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "functions"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.toml
new file mode 100644
index 0000000..291680c
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "functions"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/output.txt
new file mode 100644
index 0000000..6657c63
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/output.txt
@@ -0,0 +1,18 @@
+$ cargo run
+ Compiling functions v0.1.0 (file:///projects/functions)
+error[E0308]: mismatched types
+ --> src/main.rs:7:24
+ |
+7 | fn plus_one(x: i32) -> i32 {
+ | -------- ^^^ expected `i32`, found `()`
+ | |
+ | implicitly returns `()` as its body has no tail or `return` expression
+8 | x + 1;
+ | - help: consider removing this semicolon
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
+error: could not compile `functions`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/src/main.rs
new file mode 100644
index 0000000..c9c4edc
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/src/main.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let x = plus_one(5);
+
+ println!("The value of x is: {}", x);
+}
+
+fn plus_one(x: i32) -> i32 {
+ x + 1;
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.lock
new file mode 100644
index 0000000..a289136
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "comments"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.toml
new file mode 100644
index 0000000..c53d875
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "comments"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/src/main.rs
new file mode 100644
index 0000000..535f4b9
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ let lucky_number = 7; // I’m feeling lucky today
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.lock
new file mode 100644
index 0000000..a289136
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "comments"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.toml
new file mode 100644
index 0000000..c53d875
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "comments"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/src/main.rs
new file mode 100644
index 0000000..81cd935
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/src/main.rs
@@ -0,0 +1,4 @@
+fn main() {
+ // I’m feeling lucky today
+ let lucky_number = 7;
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.lock
new file mode 100644
index 0000000..4ca0c2d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "branches"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.toml
new file mode 100644
index 0000000..8ddf691
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "branches"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-26-if-true/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-26-if-true/output.txt
new file mode 100644
index 0000000..3d8c7dc
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-26-if-true/output.txt
@@ -0,0 +1,5 @@
+$ cargo run
+ Compiling branches v0.1.0 (file:///projects/branches)
+ Finished dev [unoptimized + debuginfo] target(s) in 0.31s
+ Running `target/debug/branches`
+condition was true
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-26-if-true/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-26-if-true/src/main.rs
new file mode 100644
index 0000000..e64a42a
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-26-if-true/src/main.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let number = 3;
+
+ if number < 5 {
+ println!("condition was true");
+ } else {
+ println!("condition was false");
+ }
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.lock
new file mode 100644
index 0000000..4ca0c2d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "branches"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.toml
new file mode 100644
index 0000000..8ddf691
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "branches"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-27-if-false/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-27-if-false/output.txt
new file mode 100644
index 0000000..e40da96
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-27-if-false/output.txt
@@ -0,0 +1,5 @@
+$ cargo run
+ Compiling branches v0.1.0 (file:///projects/branches)
+ Finished dev [unoptimized + debuginfo] target(s) in 0.31s
+ Running `target/debug/branches`
+condition was false
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-27-if-false/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-27-if-false/src/main.rs
new file mode 100644
index 0000000..f7d76cf
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-27-if-false/src/main.rs
@@ -0,0 +1,11 @@
+fn main() {
+ // ANCHOR: here
+ let number = 7;
+ // ANCHOR_END: here
+
+ if number < 5 {
+ println!("condition was true");
+ } else {
+ println!("condition was false");
+ }
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.lock
new file mode 100644
index 0000000..4ca0c2d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "branches"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.toml
new file mode 100644
index 0000000..8ddf691
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "branches"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/output.txt
new file mode 100644
index 0000000..5ddb737
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/output.txt
@@ -0,0 +1,14 @@
+$ cargo run
+ Compiling branches v0.1.0 (file:///projects/branches)
+error[E0308]: mismatched types
+ --> src/main.rs:4:8
+ |
+4 | if number {
+ | ^^^^^^ expected `bool`, found integer
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
+error: could not compile `branches`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/src/main.rs
new file mode 100644
index 0000000..bc4af76
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/src/main.rs
@@ -0,0 +1,7 @@
+fn main() {
+ let number = 3;
+
+ if number {
+ println!("number was three");
+ }
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.lock
new file mode 100644
index 0000000..4ca0c2d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "branches"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.toml
new file mode 100644
index 0000000..8ddf691
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "branches"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/src/main.rs
new file mode 100644
index 0000000..704650f
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/src/main.rs
@@ -0,0 +1,7 @@
+fn main() {
+ let number = 3;
+
+ if number != 0 {
+ println!("number was something other than zero");
+ }
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.lock
new file mode 100644
index 0000000..4ca0c2d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "branches"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.toml
new file mode 100644
index 0000000..8ddf691
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "branches"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-30-else-if/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-30-else-if/output.txt
new file mode 100644
index 0000000..b218941
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-30-else-if/output.txt
@@ -0,0 +1,5 @@
+$ cargo run
+ Compiling branches v0.1.0 (file:///projects/branches)
+ Finished dev [unoptimized + debuginfo] target(s) in 0.31s
+ Running `target/debug/branches`
+number is divisible by 3
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-30-else-if/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-30-else-if/src/main.rs
new file mode 100644
index 0000000..d0ef9b2
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-30-else-if/src/main.rs
@@ -0,0 +1,13 @@
+fn main() {
+ let number = 6;
+
+ if number % 4 == 0 {
+ println!("number is divisible by 4");
+ } else if number % 3 == 0 {
+ println!("number is divisible by 3");
+ } else if number % 2 == 0 {
+ println!("number is divisible by 2");
+ } else {
+ println!("number is not divisible by 4, 3, or 2");
+ }
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.lock
new file mode 100644
index 0000000..4ca0c2d
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "branches"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.toml
new file mode 100644
index 0000000..8ddf691
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "branches"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/output.txt b/english/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/output.txt
new file mode 100644
index 0000000..90934b6
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/output.txt
@@ -0,0 +1,16 @@
+$ cargo run
+ Compiling branches v0.1.0 (file:///projects/branches)
+error[E0308]: `if` and `else` have incompatible types
+ --> src/main.rs:4:44
+ |
+4 | let number = if condition { 5 } else { "six" };
+ | - ^^^^^ expected integer, found `&str`
+ | |
+ | expected because of this
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
+error: could not compile `branches`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/src/main.rs
new file mode 100644
index 0000000..440b286
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/src/main.rs
@@ -0,0 +1,7 @@
+fn main() {
+ let condition = true;
+
+ let number = if condition { 5 } else { "six" };
+
+ println!("The value of number is: {}", number);
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.lock
new file mode 100644
index 0000000..9942b36
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "loops"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.toml
new file mode 100644
index 0000000..b5ed848
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "loops"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-32-loop/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-32-loop/src/main.rs
new file mode 100644
index 0000000..f1692e4
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-32-loop/src/main.rs
@@ -0,0 +1,5 @@
+fn main() {
+ loop {
+ println!("again!");
+ }
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.lock
new file mode 100644
index 0000000..9942b36
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "loops"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.toml
new file mode 100644
index 0000000..b5ed848
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "loops"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/src/main.rs
new file mode 100644
index 0000000..6ffdab5
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/src/main.rs
@@ -0,0 +1,13 @@
+fn main() {
+ let mut counter = 0;
+
+ let result = loop {
+ counter += 1;
+
+ if counter == 10 {
+ break counter * 2;
+ }
+ };
+
+ println!("The result is {}", result);
+}
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.lock b/english/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.lock
new file mode 100644
index 0000000..9942b36
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "loops"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.toml b/english/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.toml
new file mode 100644
index 0000000..b5ed848
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "loops"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/no-listing-34-for-range/src/main.rs b/english/listings/ch03-common-programming-concepts/no-listing-34-for-range/src/main.rs
new file mode 100644
index 0000000..e7286a8
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/no-listing-34-for-range/src/main.rs
@@ -0,0 +1,6 @@
+fn main() {
+ for number in (1..4).rev() {
+ println!("{}!", number);
+ }
+ println!("LIFTOFF!!!");
+}
diff --git a/english/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.lock b/english/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.lock
new file mode 100644
index 0000000..b5664bc
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "no_type_annotations"
+version = "0.1.0"
+
diff --git a/english/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.toml b/english/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.toml
new file mode 100644
index 0000000..964f9e8
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "no_type_annotations"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/english/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/output.txt b/english/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/output.txt
new file mode 100644
index 0000000..df0ed35
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/output.txt
@@ -0,0 +1,14 @@
+$ cargo build
+ Compiling no_type_annotations v0.1.0 (file:///projects/no_type_annotations)
+error[E0282]: type annotations needed
+ --> src/main.rs:2:9
+ |
+2 | let guess = "42".parse().expect("Not a number!");
+ | ^^^^^ consider giving `guess` a type
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
+error: could not compile `no_type_annotations`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/src/main.rs b/english/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/src/main.rs
new file mode 100644
index 0000000..f41c558
--- /dev/null
+++ b/english/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ let guess = "42".parse().expect("Not a number!");
+}
diff --git a/english/listings/ch04-understanding-ownership/listing-04-01/Cargo.lock b/english/listings/ch04-understanding-ownership/listing-04-01/Cargo.lock
new file mode 100644
index 0000000..9e4e62d
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-01/Cargo.lock
@@ -0,0 +1,4 @@
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/listing-04-01/Cargo.toml b/english/listings/ch04-understanding-ownership/listing-04-01/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-01/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/listing-04-01/rustfmt-ignore b/english/listings/ch04-understanding-ownership/listing-04-01/rustfmt-ignore
new file mode 100644
index 0000000..9a53c71
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-01/rustfmt-ignore
@@ -0,0 +1,3 @@
+We have some weird comments pointing out borrowing scopes that we don't want to change;
+unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to
+manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028
diff --git a/english/listings/ch04-understanding-ownership/listing-04-01/src/main.rs b/english/listings/ch04-understanding-ownership/listing-04-01/src/main.rs
new file mode 100644
index 0000000..148ad84
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-01/src/main.rs
@@ -0,0 +1,9 @@
+fn main() {
+ // ANCHOR: here
+ { // s is not valid here, it’s not yet declared
+ let s = "hello"; // s is valid from this point forward
+
+ // do stuff with s
+ } // this scope is now over, and s is no longer valid
+ // ANCHOR_END: here
+}
\ No newline at end of file
diff --git a/english/listings/ch04-understanding-ownership/listing-04-02/Cargo.lock b/english/listings/ch04-understanding-ownership/listing-04-02/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-02/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/listing-04-02/Cargo.toml b/english/listings/ch04-understanding-ownership/listing-04-02/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-02/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/listing-04-02/src/main.rs b/english/listings/ch04-understanding-ownership/listing-04-02/src/main.rs
new file mode 100644
index 0000000..de0f1b3
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-02/src/main.rs
@@ -0,0 +1,6 @@
+fn main() {
+ // ANCHOR: here
+ let x = 5;
+ let y = x;
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch04-understanding-ownership/listing-04-03/Cargo.lock b/english/listings/ch04-understanding-ownership/listing-04-03/Cargo.lock
new file mode 100644
index 0000000..9e4e62d
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-03/Cargo.lock
@@ -0,0 +1,4 @@
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/listing-04-03/Cargo.toml b/english/listings/ch04-understanding-ownership/listing-04-03/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-03/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/listing-04-03/rustfmt-ignore b/english/listings/ch04-understanding-ownership/listing-04-03/rustfmt-ignore
new file mode 100644
index 0000000..9a53c71
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-03/rustfmt-ignore
@@ -0,0 +1,3 @@
+We have some weird comments pointing out borrowing scopes that we don't want to change;
+unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to
+manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028
diff --git a/english/listings/ch04-understanding-ownership/listing-04-03/src/main.rs b/english/listings/ch04-understanding-ownership/listing-04-03/src/main.rs
new file mode 100644
index 0000000..b001cc5
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-03/src/main.rs
@@ -0,0 +1,23 @@
+fn main() {
+ let s = String::from("hello"); // s comes into scope
+
+ takes_ownership(s); // s's value moves into the function...
+ // ... and so is no longer valid here
+
+ let x = 5; // x comes into scope
+
+ makes_copy(x); // x would move into the function,
+ // but i32 is Copy, so it's okay to still
+ // use x afterward
+
+} // Here, x goes out of scope, then s. But because s's value was moved, nothing
+ // special happens.
+
+fn takes_ownership(some_string: String) { // some_string comes into scope
+ println!("{}", some_string);
+} // Here, some_string goes out of scope and `drop` is called. The backing
+ // memory is freed.
+
+fn makes_copy(some_integer: i32) { // some_integer comes into scope
+ println!("{}", some_integer);
+} // Here, some_integer goes out of scope. Nothing special happens.
diff --git a/english/listings/ch04-understanding-ownership/listing-04-04/Cargo.lock b/english/listings/ch04-understanding-ownership/listing-04-04/Cargo.lock
new file mode 100644
index 0000000..9e4e62d
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-04/Cargo.lock
@@ -0,0 +1,4 @@
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/listing-04-04/Cargo.toml b/english/listings/ch04-understanding-ownership/listing-04-04/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-04/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/listing-04-04/rustfmt-ignore b/english/listings/ch04-understanding-ownership/listing-04-04/rustfmt-ignore
new file mode 100644
index 0000000..9a53c71
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-04/rustfmt-ignore
@@ -0,0 +1,3 @@
+We have some weird comments pointing out borrowing scopes that we don't want to change;
+unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to
+manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028
diff --git a/english/listings/ch04-understanding-ownership/listing-04-04/src/main.rs b/english/listings/ch04-understanding-ownership/listing-04-04/src/main.rs
new file mode 100644
index 0000000..e3e54a8
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-04/src/main.rs
@@ -0,0 +1,29 @@
+fn main() {
+ let s1 = gives_ownership(); // gives_ownership moves its return
+ // value into s1
+
+ let s2 = String::from("hello"); // s2 comes into scope
+
+ let s3 = takes_and_gives_back(s2); // s2 is moved into
+ // takes_and_gives_back, which also
+ // moves its return value into s3
+} // Here, s3 goes out of scope and is dropped. s2 goes out of scope but was
+ // moved, so nothing happens. s1 goes out of scope and is dropped.
+
+fn gives_ownership() -> String { // gives_ownership will move its
+ // return value into the function
+ // that calls it
+
+ let some_string = String::from("hello"); // some_string comes into scope
+
+ some_string // some_string is returned and
+ // moves out to the calling
+ // function
+}
+
+// takes_and_gives_back will take a String and return one
+fn takes_and_gives_back(a_string: String) -> String { // a_string comes into
+ // scope
+
+ a_string // a_string is returned and moves out to the calling function
+}
diff --git a/english/listings/ch04-understanding-ownership/listing-04-05/Cargo.lock b/english/listings/ch04-understanding-ownership/listing-04-05/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-05/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/listing-04-05/Cargo.toml b/english/listings/ch04-understanding-ownership/listing-04-05/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-05/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/listing-04-05/src/main.rs b/english/listings/ch04-understanding-ownership/listing-04-05/src/main.rs
new file mode 100644
index 0000000..22aee14
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-05/src/main.rs
@@ -0,0 +1,13 @@
+fn main() {
+ let s1 = String::from("hello");
+
+ let (s2, len) = calculate_length(s1);
+
+ println!("The length of '{}' is {}.", s2, len);
+}
+
+fn calculate_length(s: String) -> (String, usize) {
+ let length = s.len(); // len() returns the length of a String
+
+ (s, length)
+}
diff --git a/english/listings/ch04-understanding-ownership/listing-04-06/Cargo.lock b/english/listings/ch04-understanding-ownership/listing-04-06/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-06/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/listing-04-06/Cargo.toml b/english/listings/ch04-understanding-ownership/listing-04-06/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-06/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/listing-04-06/output.txt b/english/listings/ch04-understanding-ownership/listing-04-06/output.txt
new file mode 100644
index 0000000..b62dbd0
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-06/output.txt
@@ -0,0 +1,16 @@
+$ cargo run
+ Compiling ownership v0.1.0 (file:///projects/ownership)
+error[E0596]: cannot borrow `*some_string` as mutable, as it is behind a `&` reference
+ --> src/main.rs:8:5
+ |
+7 | fn change(some_string: &String) {
+ | ------- help: consider changing this to be a mutable reference: `&mut String`
+8 | some_string.push_str(", world");
+ | ^^^^^^^^^^^ `some_string` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0596`.
+error: could not compile `ownership`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch04-understanding-ownership/listing-04-06/src/main.rs b/english/listings/ch04-understanding-ownership/listing-04-06/src/main.rs
new file mode 100644
index 0000000..330ffa6
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-06/src/main.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let s = String::from("hello");
+
+ change(&s);
+}
+
+fn change(some_string: &String) {
+ some_string.push_str(", world");
+}
diff --git a/english/listings/ch04-understanding-ownership/listing-04-07/Cargo.lock b/english/listings/ch04-understanding-ownership/listing-04-07/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-07/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/listing-04-07/Cargo.toml b/english/listings/ch04-understanding-ownership/listing-04-07/Cargo.toml
new file mode 100644
index 0000000..dddcb5a
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-07/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Carol (Nichols || Goulding) "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/listing-04-07/src/main.rs b/english/listings/ch04-understanding-ownership/listing-04-07/src/main.rs
new file mode 100644
index 0000000..3bb3c85
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-07/src/main.rs
@@ -0,0 +1,21 @@
+// ANCHOR: here
+fn first_word(s: &String) -> usize {
+ // ANCHOR: as_bytes
+ let bytes = s.as_bytes();
+ // ANCHOR_END: as_bytes
+
+ // ANCHOR: iter
+ for (i, &item) in bytes.iter().enumerate() {
+ // ANCHOR_END: iter
+ // ANCHOR: inside_for
+ if item == b' ' {
+ return i;
+ }
+ }
+
+ s.len()
+ // ANCHOR_END: inside_for
+}
+// ANCHOR_END: here
+
+fn main() {}
diff --git a/english/listings/ch04-understanding-ownership/listing-04-08/Cargo.lock b/english/listings/ch04-understanding-ownership/listing-04-08/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-08/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/listing-04-08/Cargo.toml b/english/listings/ch04-understanding-ownership/listing-04-08/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-08/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/listing-04-08/src/main.rs b/english/listings/ch04-understanding-ownership/listing-04-08/src/main.rs
new file mode 100644
index 0000000..b6182fe
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-08/src/main.rs
@@ -0,0 +1,24 @@
+fn first_word(s: &String) -> usize {
+ let bytes = s.as_bytes();
+
+ for (i, &item) in bytes.iter().enumerate() {
+ if item == b' ' {
+ return i;
+ }
+ }
+
+ s.len()
+}
+
+// ANCHOR: here
+fn main() {
+ let mut s = String::from("hello world");
+
+ let word = first_word(&s); // word will get the value 5
+
+ s.clear(); // this empties the String, making it equal to ""
+
+ // word still has the value 5 here, but there's no more string that
+ // we could meaningfully use the value 5 with. word is now totally invalid!
+}
+// ANCHOR_END: here
diff --git a/english/listings/ch04-understanding-ownership/listing-04-09/Cargo.lock b/english/listings/ch04-understanding-ownership/listing-04-09/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-09/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/listing-04-09/Cargo.toml b/english/listings/ch04-understanding-ownership/listing-04-09/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-09/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/listing-04-09/src/main.rs b/english/listings/ch04-understanding-ownership/listing-04-09/src/main.rs
new file mode 100644
index 0000000..19a9cc7
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/listing-04-09/src/main.rs
@@ -0,0 +1,31 @@
+// ANCHOR: here
+fn first_word(s: &str) -> &str {
+ // ANCHOR_END: here
+ let bytes = s.as_bytes();
+
+ for (i, &item) in bytes.iter().enumerate() {
+ if item == b' ' {
+ return &s[0..i];
+ }
+ }
+
+ &s[..]
+}
+
+// ANCHOR: usage
+fn main() {
+ let my_string = String::from("hello world");
+
+ // first_word works on slices of `String`s
+ let word = first_word(&my_string[..]);
+
+ let my_string_literal = "hello world";
+
+ // first_word works on slices of string literals
+ let word = first_word(&my_string_literal[..]);
+
+ // Because string literals *are* string slices already,
+ // this works too, without the slice syntax!
+ let word = first_word(my_string_literal);
+}
+// ANCHOR_END: usage
diff --git a/english/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs
new file mode 100644
index 0000000..b68f0f1
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs
@@ -0,0 +1,9 @@
+fn main() {
+ // ANCHOR: here
+ let mut s = String::from("hello");
+
+ s.push_str(", world!"); // push_str() appends a literal to a String
+
+ println!("{}", s); // This will print `hello, world!`
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.lock
new file mode 100644
index 0000000..9e4e62d
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.lock
@@ -0,0 +1,4 @@
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-02-string-scope/rustfmt-ignore b/english/listings/ch04-understanding-ownership/no-listing-02-string-scope/rustfmt-ignore
new file mode 100644
index 0000000..9a53c71
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-02-string-scope/rustfmt-ignore
@@ -0,0 +1,3 @@
+We have some weird comments pointing out borrowing scopes that we don't want to change;
+unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to
+manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028
diff --git a/english/listings/ch04-understanding-ownership/no-listing-02-string-scope/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-02-string-scope/src/main.rs
new file mode 100644
index 0000000..7e6d46f
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-02-string-scope/src/main.rs
@@ -0,0 +1,10 @@
+fn main() {
+ // ANCHOR: here
+ {
+ let s = String::from("hello"); // s is valid from this point forward
+
+ // do stuff with s
+ } // this scope is now over, and s is no
+ // longer valid
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-03-string-move/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-03-string-move/src/main.rs
new file mode 100644
index 0000000..a5817e7
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-03-string-move/src/main.rs
@@ -0,0 +1,6 @@
+fn main() {
+ // ANCHOR: here
+ let s1 = String::from("hello");
+ let s2 = s1;
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/output.txt b/english/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/output.txt
new file mode 100644
index 0000000..b69c878
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/output.txt
@@ -0,0 +1,19 @@
+$ cargo run
+ Compiling ownership v0.1.0 (file:///projects/ownership)
+error[E0382]: borrow of moved value: `s1`
+ --> src/main.rs:5:28
+ |
+2 | let s1 = String::from("hello");
+ | -- move occurs because `s1` has type `String`, which does not implement the `Copy` trait
+3 | let s2 = s1;
+ | -- value moved here
+4 |
+5 | println!("{}, world!", s1);
+ | ^^ value borrowed here after move
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0382`.
+error: could not compile `ownership`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/src/main.rs
new file mode 100644
index 0000000..d0b9f18
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/src/main.rs
@@ -0,0 +1,8 @@
+fn main() {
+ // ANCHOR: here
+ let s1 = String::from("hello");
+ let s2 = s1;
+
+ println!("{}, world!", s1);
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-05-clone/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-05-clone/src/main.rs
new file mode 100644
index 0000000..4e61cc1
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-05-clone/src/main.rs
@@ -0,0 +1,8 @@
+fn main() {
+ // ANCHOR: here
+ let s1 = String::from("hello");
+ let s2 = s1.clone();
+
+ println!("s1 = {}, s2 = {}", s1, s2);
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-06-copy/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-06-copy/src/main.rs
new file mode 100644
index 0000000..63a1fae
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-06-copy/src/main.rs
@@ -0,0 +1,8 @@
+fn main() {
+ // ANCHOR: here
+ let x = 5;
+ let y = x;
+
+ println!("x = {}, y = {}", x, y);
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-07-reference/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-07-reference/src/main.rs
new file mode 100644
index 0000000..fd32a5f
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-07-reference/src/main.rs
@@ -0,0 +1,15 @@
+// ANCHOR: all
+fn main() {
+ // ANCHOR: here
+ let s1 = String::from("hello");
+
+ let len = calculate_length(&s1);
+ // ANCHOR_END: here
+
+ println!("The length of '{}' is {}.", s1, len);
+}
+
+fn calculate_length(s: &String) -> usize {
+ s.len()
+}
+// ANCHOR_END: all
diff --git a/english/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.lock
new file mode 100644
index 0000000..9e4e62d
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.lock
@@ -0,0 +1,4 @@
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/rustfmt-ignore b/english/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/rustfmt-ignore
new file mode 100644
index 0000000..9a53c71
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/rustfmt-ignore
@@ -0,0 +1,3 @@
+We have some weird comments pointing out borrowing scopes that we don't want to change;
+unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to
+manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028
diff --git a/english/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/src/main.rs
new file mode 100644
index 0000000..6e40b8c
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/src/main.rs
@@ -0,0 +1,14 @@
+fn main() {
+ let s1 = String::from("hello");
+
+ let len = calculate_length(&s1);
+
+ println!("The length of '{}' is {}.", s1, len);
+}
+
+// ANCHOR: here
+fn calculate_length(s: &String) -> usize { // s is a reference to a String
+ s.len()
+} // Here, s goes out of scope. But because it does not have ownership of what
+ // it refers to, nothing happens.
+// ANCHOR_END: here
diff --git a/english/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/src/main.rs
new file mode 100644
index 0000000..fdf7f0a
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/src/main.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let mut s = String::from("hello");
+
+ change(&mut s);
+}
+
+fn change(some_string: &mut String) {
+ some_string.push_str(", world");
+}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/output.txt b/english/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/output.txt
new file mode 100644
index 0000000..7e40a22
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/output.txt
@@ -0,0 +1,19 @@
+$ cargo run
+ Compiling ownership v0.1.0 (file:///projects/ownership)
+error[E0499]: cannot borrow `s` as mutable more than once at a time
+ --> src/main.rs:5:14
+ |
+4 | let r1 = &mut s;
+ | ------ first mutable borrow occurs here
+5 | let r2 = &mut s;
+ | ^^^^^^ second mutable borrow occurs here
+6 |
+7 | println!("{}, {}", r1, r2);
+ | -- first borrow later used here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0499`.
+error: could not compile `ownership`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/src/main.rs
new file mode 100644
index 0000000..ddbf812
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/src/main.rs
@@ -0,0 +1,10 @@
+fn main() {
+ // ANCHOR: here
+ let mut s = String::from("hello");
+
+ let r1 = &mut s;
+ let r2 = &mut s;
+
+ println!("{}, {}", r1, r2);
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/src/main.rs
new file mode 100644
index 0000000..4b1a5a3
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/src/main.rs
@@ -0,0 +1,11 @@
+fn main() {
+ // ANCHOR: here
+ let mut s = String::from("hello");
+
+ {
+ let r1 = &mut s;
+ } // r1 goes out of scope here, so we can make a new reference with no problems.
+
+ let r2 = &mut s;
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/output.txt b/english/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/output.txt
new file mode 100644
index 0000000..25ca954
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/output.txt
@@ -0,0 +1,20 @@
+$ cargo run
+ Compiling ownership v0.1.0 (file:///projects/ownership)
+error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immutable
+ --> src/main.rs:6:14
+ |
+4 | let r1 = &s; // no problem
+ | -- immutable borrow occurs here
+5 | let r2 = &s; // no problem
+6 | let r3 = &mut s; // BIG PROBLEM
+ | ^^^^^^ mutable borrow occurs here
+7 |
+8 | println!("{}, {}, and {}", r1, r2, r3);
+ | -- immutable borrow later used here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0502`.
+error: could not compile `ownership`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/src/main.rs
new file mode 100644
index 0000000..0da04c0
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/src/main.rs
@@ -0,0 +1,11 @@
+fn main() {
+ // ANCHOR: here
+ let mut s = String::from("hello");
+
+ let r1 = &s; // no problem
+ let r2 = &s; // no problem
+ let r3 = &mut s; // BIG PROBLEM
+
+ println!("{}, {}, and {}", r1, r2, r3);
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/src/main.rs
new file mode 100644
index 0000000..3b0a7da
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/src/main.rs
@@ -0,0 +1,13 @@
+fn main() {
+ // ANCHOR: here
+ let mut s = String::from("hello");
+
+ let r1 = &s; // no problem
+ let r2 = &s; // no problem
+ println!("{} and {}", r1, r2);
+ // r1 and r2 are no longer used after this point
+
+ let r3 = &mut s; // no problem
+ println!("{}", r3);
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/output.txt b/english/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/output.txt
new file mode 100644
index 0000000..dc23312
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/output.txt
@@ -0,0 +1,20 @@
+$ cargo run
+ Compiling ownership v0.1.0 (file:///projects/ownership)
+error[E0106]: missing lifetime specifier
+ --> src/main.rs:5:16
+ |
+5 | fn dangle() -> &String {
+ | ^ expected named lifetime parameter
+ |
+ = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+ |
+5 | fn dangle() -> &'static String {
+ | ^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0106`.
+error: could not compile `ownership`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/src/main.rs
new file mode 100644
index 0000000..b102697
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/src/main.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let reference_to_nothing = dangle();
+}
+
+fn dangle() -> &String {
+ let s = String::from("hello");
+
+ &s
+}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.lock
new file mode 100644
index 0000000..9e4e62d
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.lock
@@ -0,0 +1,4 @@
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/rustfmt-ignore b/english/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/rustfmt-ignore
new file mode 100644
index 0000000..9a53c71
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/rustfmt-ignore
@@ -0,0 +1,3 @@
+We have some weird comments pointing out borrowing scopes that we don't want to change;
+unfortunately I haven't found a way to skip them with rustfmt that works so for now we're going to
+manually skip those listings. See: https://github.com/rust-lang/rustfmt/issues/4028
diff --git a/english/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/src/main.rs
new file mode 100644
index 0000000..9fbb372
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/src/main.rs
@@ -0,0 +1,13 @@
+fn main() {
+ let reference_to_nothing = dangle();
+}
+
+// ANCHOR: here
+fn dangle() -> &String { // dangle returns a reference to a String
+
+ let s = String::from("hello"); // s is a new String
+
+ &s // we return a reference to the String, s
+} // Here, s goes out of scope, and is dropped. Its memory goes away.
+ // Danger!
+// ANCHOR_END: here
diff --git a/english/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-16-no-dangle/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-16-no-dangle/src/main.rs
new file mode 100644
index 0000000..9c20a3b
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-16-no-dangle/src/main.rs
@@ -0,0 +1,11 @@
+fn main() {
+ let string = no_dangle();
+}
+
+// ANCHOR: here
+fn no_dangle() -> String {
+ let s = String::from("hello");
+
+ s
+}
+// ANCHOR_END: here
diff --git a/english/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-17-slice/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-17-slice/src/main.rs
new file mode 100644
index 0000000..44163af
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-17-slice/src/main.rs
@@ -0,0 +1,8 @@
+fn main() {
+ // ANCHOR: here
+ let s = String::from("hello world");
+
+ let hello = &s[0..5];
+ let world = &s[6..11];
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/src/main.rs
new file mode 100644
index 0000000..f44a970
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/src/main.rs
@@ -0,0 +1,15 @@
+// ANCHOR: here
+fn first_word(s: &String) -> &str {
+ let bytes = s.as_bytes();
+
+ for (i, &item) in bytes.iter().enumerate() {
+ if item == b' ' {
+ return &s[0..i];
+ }
+ }
+
+ &s[..]
+}
+// ANCHOR_END: here
+
+fn main() {}
diff --git a/english/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.lock b/english/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.lock
new file mode 100644
index 0000000..2aa4918
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "ownership"
+version = "0.1.0"
+
diff --git a/english/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.toml b/english/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.toml
new file mode 100644
index 0000000..686de93
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "ownership"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch04-understanding-ownership/no-listing-19-slice-error/output.txt b/english/listings/ch04-understanding-ownership/no-listing-19-slice-error/output.txt
new file mode 100644
index 0000000..503a503
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-19-slice-error/output.txt
@@ -0,0 +1,20 @@
+$ cargo run
+ Compiling ownership v0.1.0 (file:///projects/ownership)
+error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immutable
+ --> src/main.rs:18:5
+ |
+16 | let word = first_word(&s);
+ | -- immutable borrow occurs here
+17 |
+18 | s.clear(); // error!
+ | ^^^^^^^^^ mutable borrow occurs here
+19 |
+20 | println!("the first word is: {}", word);
+ | ---- immutable borrow later used here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0502`.
+error: could not compile `ownership`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch04-understanding-ownership/no-listing-19-slice-error/src/main.rs b/english/listings/ch04-understanding-ownership/no-listing-19-slice-error/src/main.rs
new file mode 100644
index 0000000..99e0401
--- /dev/null
+++ b/english/listings/ch04-understanding-ownership/no-listing-19-slice-error/src/main.rs
@@ -0,0 +1,23 @@
+fn first_word(s: &String) -> &str {
+ let bytes = s.as_bytes();
+
+ for (i, &item) in bytes.iter().enumerate() {
+ if item == b' ' {
+ return &s[0..i];
+ }
+ }
+
+ &s[..]
+}
+
+// ANCHOR: here
+fn main() {
+ let mut s = String::from("hello world");
+
+ let word = first_word(&s);
+
+ s.clear(); // error!
+
+ println!("the first word is: {}", word);
+}
+// ANCHOR_END: here
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.lock
new file mode 100644
index 0000000..bede081
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "structs"
+version = "0.1.0"
+
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.toml
new file mode 100644
index 0000000..431e5c3
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "structs"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-01/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-01/src/main.rs
new file mode 100644
index 0000000..a7cff6e
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-01/src/main.rs
@@ -0,0 +1,10 @@
+// ANCHOR: here
+struct User {
+ username: String,
+ email: String,
+ sign_in_count: u64,
+ active: bool,
+}
+// ANCHOR_END: here
+
+fn main() {}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.lock
new file mode 100644
index 0000000..bede081
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "structs"
+version = "0.1.0"
+
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.toml
new file mode 100644
index 0000000..431e5c3
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "structs"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-02/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-02/src/main.rs
new file mode 100644
index 0000000..390c8ff
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-02/src/main.rs
@@ -0,0 +1,17 @@
+struct User {
+ username: String,
+ email: String,
+ sign_in_count: u64,
+ active: bool,
+}
+
+fn main() {
+ // ANCHOR: here
+ let user1 = User {
+ email: String::from("someone@example.com"),
+ username: String::from("someusername123"),
+ active: true,
+ sign_in_count: 1,
+ };
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.lock
new file mode 100644
index 0000000..bede081
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "structs"
+version = "0.1.0"
+
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.toml
new file mode 100644
index 0000000..431e5c3
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "structs"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-03/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-03/src/main.rs
new file mode 100644
index 0000000..c599c9d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-03/src/main.rs
@@ -0,0 +1,19 @@
+struct User {
+ username: String,
+ email: String,
+ sign_in_count: u64,
+ active: bool,
+}
+
+fn main() {
+ // ANCHOR: here
+ let mut user1 = User {
+ email: String::from("someone@example.com"),
+ username: String::from("someusername123"),
+ active: true,
+ sign_in_count: 1,
+ };
+
+ user1.email = String::from("anotheremail@example.com");
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.lock
new file mode 100644
index 0000000..bede081
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "structs"
+version = "0.1.0"
+
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.toml
new file mode 100644
index 0000000..431e5c3
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "structs"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-04/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-04/src/main.rs
new file mode 100644
index 0000000..f934d4c
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-04/src/main.rs
@@ -0,0 +1,24 @@
+struct User {
+ username: String,
+ email: String,
+ sign_in_count: u64,
+ active: bool,
+}
+
+// ANCHOR: here
+fn build_user(email: String, username: String) -> User {
+ User {
+ email: email,
+ username: username,
+ active: true,
+ sign_in_count: 1,
+ }
+}
+// ANCHOR_END: here
+
+fn main() {
+ let user1 = build_user(
+ String::from("someone@example.com"),
+ String::from("someusername123"),
+ );
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.lock
new file mode 100644
index 0000000..bede081
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "structs"
+version = "0.1.0"
+
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.toml
new file mode 100644
index 0000000..431e5c3
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "structs"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-05/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-05/src/main.rs
new file mode 100644
index 0000000..1833aa8
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-05/src/main.rs
@@ -0,0 +1,24 @@
+struct User {
+ username: String,
+ email: String,
+ sign_in_count: u64,
+ active: bool,
+}
+
+// ANCHOR: here
+fn build_user(email: String, username: String) -> User {
+ User {
+ email,
+ username,
+ active: true,
+ sign_in_count: 1,
+ }
+}
+// ANCHOR_END: here
+
+fn main() {
+ let user1 = build_user(
+ String::from("someone@example.com"),
+ String::from("someusername123"),
+ );
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.lock
new file mode 100644
index 0000000..bede081
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "structs"
+version = "0.1.0"
+
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.toml
new file mode 100644
index 0000000..431e5c3
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "structs"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-06/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-06/src/main.rs
new file mode 100644
index 0000000..6c6d83d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-06/src/main.rs
@@ -0,0 +1,24 @@
+struct User {
+ username: String,
+ email: String,
+ sign_in_count: u64,
+ active: bool,
+}
+
+fn main() {
+ let user1 = User {
+ email: String::from("someone@example.com"),
+ username: String::from("someusername123"),
+ active: true,
+ sign_in_count: 1,
+ };
+
+ // ANCHOR: here
+ let user2 = User {
+ email: String::from("another@example.com"),
+ username: String::from("anotherusername567"),
+ active: user1.active,
+ sign_in_count: user1.sign_in_count,
+ };
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.lock
new file mode 100644
index 0000000..bede081
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "structs"
+version = "0.1.0"
+
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.toml
new file mode 100644
index 0000000..431e5c3
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "structs"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-07/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-07/src/main.rs
new file mode 100644
index 0000000..17cef45
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-07/src/main.rs
@@ -0,0 +1,23 @@
+struct User {
+ username: String,
+ email: String,
+ sign_in_count: u64,
+ active: bool,
+}
+
+fn main() {
+ let user1 = User {
+ email: String::from("someone@example.com"),
+ username: String::from("someusername123"),
+ active: true,
+ sign_in_count: 1,
+ };
+
+ // ANCHOR: here
+ let user2 = User {
+ email: String::from("another@example.com"),
+ username: String::from("anotherusername567"),
+ ..user1
+ };
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.lock
new file mode 100644
index 0000000..4aabe7d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.lock
@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "rectangles"
+version = "0.1.0"
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.toml
new file mode 100644
index 0000000..58787d2
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "rectangles"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-08/output.txt b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-08/output.txt
new file mode 100644
index 0000000..c44b582
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-08/output.txt
@@ -0,0 +1,5 @@
+$ cargo run
+ Compiling rectangles v0.1.0 (file:///projects/rectangles)
+ Finished dev [unoptimized + debuginfo] target(s) in 0.42s
+ Running `target/debug/rectangles`
+The area of the rectangle is 1500 square pixels.
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-08/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-08/src/main.rs
new file mode 100644
index 0000000..f324529
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-08/src/main.rs
@@ -0,0 +1,17 @@
+// ANCHOR: all
+fn main() {
+ let width1 = 30;
+ let height1 = 50;
+
+ println!(
+ "The area of the rectangle is {} square pixels.",
+ area(width1, height1)
+ );
+}
+
+// ANCHOR: here
+fn area(width: u32, height: u32) -> u32 {
+ // ANCHOR_END: here
+ width * height
+}
+// ANCHOR_END: all
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.lock
new file mode 100644
index 0000000..4aabe7d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.lock
@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "rectangles"
+version = "0.1.0"
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.toml
new file mode 100644
index 0000000..58787d2
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "rectangles"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-09/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-09/src/main.rs
new file mode 100644
index 0000000..d4b77ba
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-09/src/main.rs
@@ -0,0 +1,12 @@
+fn main() {
+ let rect1 = (30, 50);
+
+ println!(
+ "The area of the rectangle is {} square pixels.",
+ area(rect1)
+ );
+}
+
+fn area(dimensions: (u32, u32)) -> u32 {
+ dimensions.0 * dimensions.1
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.lock
new file mode 100644
index 0000000..4aabe7d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.lock
@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "rectangles"
+version = "0.1.0"
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.toml
new file mode 100644
index 0000000..58787d2
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "rectangles"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-10/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-10/src/main.rs
new file mode 100644
index 0000000..62ef9ac
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-10/src/main.rs
@@ -0,0 +1,20 @@
+struct Rectangle {
+ width: u32,
+ height: u32,
+}
+
+fn main() {
+ let rect1 = Rectangle {
+ width: 30,
+ height: 50,
+ };
+
+ println!(
+ "The area of the rectangle is {} square pixels.",
+ area(&rect1)
+ );
+}
+
+fn area(rectangle: &Rectangle) -> u32 {
+ rectangle.width * rectangle.height
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.lock
new file mode 100644
index 0000000..4aabe7d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.lock
@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "rectangles"
+version = "0.1.0"
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.toml
new file mode 100644
index 0000000..58787d2
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "rectangles"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt
new file mode 100644
index 0000000..4a3f462
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt
@@ -0,0 +1,19 @@
+$ cargo run
+ Compiling rectangles v0.1.0 (file:///projects/rectangles)
+error[E0277]: `Rectangle` doesn't implement `std::fmt::Display`
+ --> src/main.rs:12:29
+ |
+12 | println!("rect1 is {}", rect1);
+ | ^^^^^ `Rectangle` cannot be formatted with the default formatter
+ |
+ = help: the trait `std::fmt::Display` is not implemented for `Rectangle`
+ = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
+ = note: required by `std::fmt::Display::fmt`
+ = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
+error: could not compile `rectangles`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-11/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-11/src/main.rs
new file mode 100644
index 0000000..0ff8dcc
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-11/src/main.rs
@@ -0,0 +1,13 @@
+struct Rectangle {
+ width: u32,
+ height: u32,
+}
+
+fn main() {
+ let rect1 = Rectangle {
+ width: 30,
+ height: 50,
+ };
+
+ println!("rect1 is {}", rect1);
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.lock
new file mode 100644
index 0000000..4aabe7d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.lock
@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "rectangles"
+version = "0.1.0"
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.toml
new file mode 100644
index 0000000..58787d2
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "rectangles"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-12/output.txt b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-12/output.txt
new file mode 100644
index 0000000..c37be6b
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-12/output.txt
@@ -0,0 +1,5 @@
+$ cargo run
+ Compiling rectangles v0.1.0 (file:///projects/rectangles)
+ Finished dev [unoptimized + debuginfo] target(s) in 0.48s
+ Running `target/debug/rectangles`
+rect1 is Rectangle { width: 30, height: 50 }
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-12/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-12/src/main.rs
new file mode 100644
index 0000000..2ffc4b8
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-12/src/main.rs
@@ -0,0 +1,14 @@
+#[derive(Debug)]
+struct Rectangle {
+ width: u32,
+ height: u32,
+}
+
+fn main() {
+ let rect1 = Rectangle {
+ width: 30,
+ height: 50,
+ };
+
+ println!("rect1 is {:?}", rect1);
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.lock
new file mode 100644
index 0000000..4aabe7d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.lock
@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "rectangles"
+version = "0.1.0"
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.toml
new file mode 100644
index 0000000..58787d2
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "rectangles"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-13/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-13/src/main.rs
new file mode 100644
index 0000000..e4f45e8
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-13/src/main.rs
@@ -0,0 +1,23 @@
+#[derive(Debug)]
+struct Rectangle {
+ width: u32,
+ height: u32,
+}
+
+impl Rectangle {
+ fn area(&self) -> u32 {
+ self.width * self.height
+ }
+}
+
+fn main() {
+ let rect1 = Rectangle {
+ width: 30,
+ height: 50,
+ };
+
+ println!(
+ "The area of the rectangle is {} square pixels.",
+ rect1.area()
+ );
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.lock
new file mode 100644
index 0000000..4aabe7d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.lock
@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "rectangles"
+version = "0.1.0"
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.toml
new file mode 100644
index 0000000..58787d2
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "rectangles"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-14/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-14/src/main.rs
new file mode 100644
index 0000000..843dab4
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-14/src/main.rs
@@ -0,0 +1,17 @@
+fn main() {
+ let rect1 = Rectangle {
+ width: 30,
+ height: 50,
+ };
+ let rect2 = Rectangle {
+ width: 10,
+ height: 40,
+ };
+ let rect3 = Rectangle {
+ width: 60,
+ height: 45,
+ };
+
+ println!("Can rect1 hold rect2? {}", rect1.can_hold(&rect2));
+ println!("Can rect1 hold rect3? {}", rect1.can_hold(&rect3));
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.lock
new file mode 100644
index 0000000..4aabe7d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.lock
@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "rectangles"
+version = "0.1.0"
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.toml
new file mode 100644
index 0000000..58787d2
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "rectangles"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-15/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-15/src/main.rs
new file mode 100644
index 0000000..e6a3272
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-15/src/main.rs
@@ -0,0 +1,35 @@
+#[derive(Debug)]
+struct Rectangle {
+ width: u32,
+ height: u32,
+}
+
+// ANCHOR: here
+impl Rectangle {
+ fn area(&self) -> u32 {
+ self.width * self.height
+ }
+
+ fn can_hold(&self, other: &Rectangle) -> bool {
+ self.width > other.width && self.height > other.height
+ }
+}
+// ANCHOR_END: here
+
+fn main() {
+ let rect1 = Rectangle {
+ width: 30,
+ height: 50,
+ };
+ let rect2 = Rectangle {
+ width: 10,
+ height: 40,
+ };
+ let rect3 = Rectangle {
+ width: 60,
+ height: 45,
+ };
+
+ println!("Can rect1 hold rect2? {}", rect1.can_hold(&rect2));
+ println!("Can rect1 hold rect3? {}", rect1.can_hold(&rect3));
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.lock
new file mode 100644
index 0000000..4aabe7d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.lock
@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "rectangles"
+version = "0.1.0"
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.toml
new file mode 100644
index 0000000..58787d2
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "rectangles"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/listing-05-16/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-16/src/main.rs
new file mode 100644
index 0000000..a5d3f77
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/listing-05-16/src/main.rs
@@ -0,0 +1,37 @@
+#[derive(Debug)]
+struct Rectangle {
+ width: u32,
+ height: u32,
+}
+
+// ANCHOR: here
+impl Rectangle {
+ fn area(&self) -> u32 {
+ self.width * self.height
+ }
+}
+
+impl Rectangle {
+ fn can_hold(&self, other: &Rectangle) -> bool {
+ self.width > other.width && self.height > other.height
+ }
+}
+// ANCHOR_END: here
+
+fn main() {
+ let rect1 = Rectangle {
+ width: 30,
+ height: 50,
+ };
+ let rect2 = Rectangle {
+ width: 10,
+ height: 40,
+ };
+ let rect3 = Rectangle {
+ width: 60,
+ height: 45,
+ };
+
+ println!("Can rect1 hold rect2? {}", rect1.can_hold(&rect2));
+ println!("Can rect1 hold rect3? {}", rect1.can_hold(&rect3));
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.lock
new file mode 100644
index 0000000..bede081
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "structs"
+version = "0.1.0"
+
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.toml
new file mode 100644
index 0000000..431e5c3
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "structs"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/src/main.rs
new file mode 100644
index 0000000..4c92c5d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/src/main.rs
@@ -0,0 +1,9 @@
+fn main() {
+ // ANCHOR: here
+ struct Color(i32, i32, i32);
+ struct Point(i32, i32, i32);
+
+ let black = Color(0, 0, 0);
+ let origin = Point(0, 0, 0);
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.lock
new file mode 100644
index 0000000..bede081
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "structs"
+version = "0.1.0"
+
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.toml
new file mode 100644
index 0000000..dec1c4b
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "structs"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/output.txt b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/output.txt
new file mode 100644
index 0000000..9b54ddd
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/output.txt
@@ -0,0 +1,33 @@
+$ cargo run
+ Compiling structs v0.1.0 (file:///projects/structs)
+error[E0106]: missing lifetime specifier
+ --> src/main.rs:2:15
+ |
+2 | username: &str,
+ | ^ expected named lifetime parameter
+ |
+help: consider introducing a named lifetime parameter
+ |
+1 | struct User<'a> {
+2 | username: &'a str,
+ |
+
+error[E0106]: missing lifetime specifier
+ --> src/main.rs:3:12
+ |
+3 | email: &str,
+ | ^ expected named lifetime parameter
+ |
+help: consider introducing a named lifetime parameter
+ |
+1 | struct User<'a> {
+2 | username: &str,
+3 | email: &'a str,
+ |
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
+error: could not compile `structs`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/src/main.rs
new file mode 100644
index 0000000..3cf6ffa
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/src/main.rs
@@ -0,0 +1,15 @@
+struct User {
+ username: &str,
+ email: &str,
+ sign_in_count: u64,
+ active: bool,
+}
+
+fn main() {
+ let user1 = User {
+ email: "someone@example.com",
+ username: "someusername123",
+ active: true,
+ sign_in_count: 1,
+ };
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.lock
new file mode 100644
index 0000000..4aabe7d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.lock
@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "rectangles"
+version = "0.1.0"
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.toml
new file mode 100644
index 0000000..58787d2
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "rectangles"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs
new file mode 100644
index 0000000..d5b1692
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/src/main.rs
@@ -0,0 +1,20 @@
+#[derive(Debug)]
+struct Rectangle {
+ width: u32,
+ height: u32,
+}
+
+// ANCHOR: here
+impl Rectangle {
+ fn square(size: u32) -> Rectangle {
+ Rectangle {
+ width: size,
+ height: size,
+ }
+ }
+}
+// ANCHOR_END: here
+
+fn main() {
+ let sq = Rectangle::square(3);
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.lock
new file mode 100644
index 0000000..4aabe7d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.lock
@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "rectangles"
+version = "0.1.0"
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.toml
new file mode 100644
index 0000000..58787d2
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "rectangles"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt b/english/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt
new file mode 100644
index 0000000..c78a008
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt
@@ -0,0 +1,19 @@
+$ cargo run
+ Compiling rectangles v0.1.0 (file:///projects/rectangles)
+error[E0277]: `Rectangle` doesn't implement `Debug`
+ --> src/main.rs:12:31
+ |
+12 | println!("rect1 is {:?}", rect1);
+ | ^^^^^ `Rectangle` cannot be formatted using `{:?}`
+ |
+ = help: the trait `Debug` is not implemented for `Rectangle`
+ = note: add `#[derive(Debug)]` or manually implement `Debug`
+ = note: required by `std::fmt::Debug::fmt`
+ = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
+error: could not compile `rectangles`
+
+To learn more, run the command again with --verbose.
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/src/main.rs
new file mode 100644
index 0000000..019a357
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/src/main.rs
@@ -0,0 +1,13 @@
+struct Rectangle {
+ width: u32,
+ height: u32,
+}
+
+fn main() {
+ let rect1 = Rectangle {
+ width: 30,
+ height: 50,
+ };
+
+ println!("rect1 is {:?}", rect1);
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.lock b/english/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.lock
new file mode 100644
index 0000000..4aabe7d
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.lock
@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "rectangles"
+version = "0.1.0"
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.toml b/english/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.toml
new file mode 100644
index 0000000..58787d2
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "rectangles"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/output.txt b/english/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/output.txt
new file mode 100644
index 0000000..db6deed
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/output.txt
@@ -0,0 +1,8 @@
+$ cargo run
+ Compiling rectangles v0.1.0 (file:///projects/rectangles)
+ Finished dev [unoptimized + debuginfo] target(s) in 0.48s
+ Running `target/debug/rectangles`
+rect1 is Rectangle {
+ width: 30,
+ height: 50,
+}
diff --git a/english/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/src/main.rs b/english/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/src/main.rs
new file mode 100644
index 0000000..84e32ae
--- /dev/null
+++ b/english/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/src/main.rs
@@ -0,0 +1,14 @@
+#[derive(Debug)]
+struct Rectangle {
+ width: u32,
+ height: u32,
+}
+
+fn main() {
+ let rect1 = Rectangle {
+ width: 30,
+ height: 50,
+ };
+
+ println!("rect1 is {:#?}", rect1);
+}
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.lock b/english/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.lock
new file mode 100644
index 0000000..f62e8ac
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "enums"
+version = "0.1.0"
+
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.toml b/english/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.toml
new file mode 100644
index 0000000..04988d1
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "enums"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-01/src/main.rs b/english/listings/ch06-enums-and-pattern-matching/listing-06-01/src/main.rs
new file mode 100644
index 0000000..5b688e0
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-01/src/main.rs
@@ -0,0 +1,23 @@
+fn main() {
+ // ANCHOR: here
+ enum IpAddrKind {
+ V4,
+ V6,
+ }
+
+ struct IpAddr {
+ kind: IpAddrKind,
+ address: String,
+ }
+
+ let home = IpAddr {
+ kind: IpAddrKind::V4,
+ address: String::from("127.0.0.1"),
+ };
+
+ let loopback = IpAddr {
+ kind: IpAddrKind::V6,
+ address: String::from("::1"),
+ };
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.lock b/english/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.lock
new file mode 100644
index 0000000..f62e8ac
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "enums"
+version = "0.1.0"
+
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.toml b/english/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.toml
new file mode 100644
index 0000000..04988d1
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "enums"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-02/src/main.rs b/english/listings/ch06-enums-and-pattern-matching/listing-06-02/src/main.rs
new file mode 100644
index 0000000..3ba7497
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-02/src/main.rs
@@ -0,0 +1,10 @@
+// ANCHOR: here
+enum Message {
+ Quit,
+ Move { x: i32, y: i32 },
+ Write(String),
+ ChangeColor(i32, i32, i32),
+}
+// ANCHOR_END: here
+
+fn main() {}
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.lock b/english/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.lock
new file mode 100644
index 0000000..f62e8ac
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "enums"
+version = "0.1.0"
+
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.toml b/english/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.toml
new file mode 100644
index 0000000..04988d1
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "enums"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-03/src/main.rs b/english/listings/ch06-enums-and-pattern-matching/listing-06-03/src/main.rs
new file mode 100644
index 0000000..93dce48
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-03/src/main.rs
@@ -0,0 +1,19 @@
+// ANCHOR: here
+enum Coin {
+ Penny,
+ Nickel,
+ Dime,
+ Quarter,
+}
+
+fn value_in_cents(coin: Coin) -> u8 {
+ match coin {
+ Coin::Penny => 1,
+ Coin::Nickel => 5,
+ Coin::Dime => 10,
+ Coin::Quarter => 25,
+ }
+}
+// ANCHOR_END: here
+
+fn main() {}
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.lock b/english/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.lock
new file mode 100644
index 0000000..f62e8ac
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "enums"
+version = "0.1.0"
+
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.toml b/english/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.toml
new file mode 100644
index 0000000..04988d1
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "enums"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-04/src/main.rs b/english/listings/ch06-enums-and-pattern-matching/listing-06-04/src/main.rs
new file mode 100644
index 0000000..3ba384f
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-04/src/main.rs
@@ -0,0 +1,17 @@
+// ANCHOR: here
+#[derive(Debug)] // so we can inspect the state in a minute
+enum UsState {
+ Alabama,
+ Alaska,
+ // --snip--
+}
+
+enum Coin {
+ Penny,
+ Nickel,
+ Dime,
+ Quarter(UsState),
+}
+// ANCHOR_END: here
+
+fn main() {}
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.lock b/english/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.lock
new file mode 100644
index 0000000..f62e8ac
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "enums"
+version = "0.1.0"
+
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.toml b/english/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.toml
new file mode 100644
index 0000000..04988d1
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "enums"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-05/src/main.rs b/english/listings/ch06-enums-and-pattern-matching/listing-06-05/src/main.rs
new file mode 100644
index 0000000..c86190a
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-05/src/main.rs
@@ -0,0 +1,18 @@
+fn main() {
+ // ANCHOR: here
+ fn plus_one(x: Option) -> Option {
+ match x {
+ // ANCHOR: first_arm
+ None => None,
+ // ANCHOR_END: first_arm
+ // ANCHOR: second_arm
+ Some(i) => Some(i + 1),
+ // ANCHOR_END: second_arm
+ }
+ }
+
+ let five = Some(5);
+ let six = plus_one(five);
+ let none = plus_one(None);
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.lock b/english/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.lock
new file mode 100644
index 0000000..f62e8ac
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "enums"
+version = "0.1.0"
+
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.toml b/english/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.toml
new file mode 100644
index 0000000..04988d1
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "enums"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch06-enums-and-pattern-matching/listing-06-06/src/main.rs b/english/listings/ch06-enums-and-pattern-matching/listing-06-06/src/main.rs
new file mode 100644
index 0000000..222d545
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/listing-06-06/src/main.rs
@@ -0,0 +1,9 @@
+fn main() {
+ // ANCHOR: here
+ let some_u8_value = Some(0u8);
+ match some_u8_value {
+ Some(3) => println!("three"),
+ _ => (),
+ }
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.lock b/english/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.lock
new file mode 100644
index 0000000..f62e8ac
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "enums"
+version = "0.1.0"
+
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.toml b/english/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.toml
new file mode 100644
index 0000000..04988d1
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "enums"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/src/main.rs b/english/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/src/main.rs
new file mode 100644
index 0000000..c631e56
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/src/main.rs
@@ -0,0 +1,22 @@
+// ANCHOR: def
+enum IpAddrKind {
+ V4,
+ V6,
+}
+// ANCHOR_END: def
+
+fn main() {
+ // ANCHOR: instance
+ let four = IpAddrKind::V4;
+ let six = IpAddrKind::V6;
+ // ANCHOR_END: instance
+
+ // ANCHOR: fn_call
+ route(IpAddrKind::V4);
+ route(IpAddrKind::V6);
+ // ANCHOR_END: fn_call
+}
+
+// ANCHOR: fn
+fn route(ip_kind: IpAddrKind) {}
+// ANCHOR_END: fn
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.lock b/english/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.lock
new file mode 100644
index 0000000..f62e8ac
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "enums"
+version = "0.1.0"
+
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.toml b/english/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.toml
new file mode 100644
index 0000000..04988d1
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "enums"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/src/main.rs b/english/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/src/main.rs
new file mode 100644
index 0000000..7d59b81
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/src/main.rs
@@ -0,0 +1,12 @@
+fn main() {
+ // ANCHOR: here
+ enum IpAddr {
+ V4(String),
+ V6(String),
+ }
+
+ let home = IpAddr::V4(String::from("127.0.0.1"));
+
+ let loopback = IpAddr::V6(String::from("::1"));
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.lock b/english/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.lock
new file mode 100644
index 0000000..f62e8ac
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "enums"
+version = "0.1.0"
+
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.toml b/english/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.toml
new file mode 100644
index 0000000..04988d1
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "enums"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/src/main.rs b/english/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/src/main.rs
new file mode 100644
index 0000000..844a140
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/src/main.rs
@@ -0,0 +1,12 @@
+fn main() {
+ // ANCHOR: here
+ enum IpAddr {
+ V4(u8, u8, u8, u8),
+ V6(String),
+ }
+
+ let home = IpAddr::V4(127, 0, 0, 1);
+
+ let loopback = IpAddr::V6(String::from("::1"));
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.lock b/english/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.lock
new file mode 100644
index 0000000..f62e8ac
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "enums"
+version = "0.1.0"
+
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.toml b/english/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.toml
new file mode 100644
index 0000000..04988d1
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "enums"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/src/main.rs b/english/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/src/main.rs
new file mode 100644
index 0000000..df451be
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/src/main.rs
@@ -0,0 +1,11 @@
+// ANCHOR: here
+struct QuitMessage; // unit struct
+struct MoveMessage {
+ x: i32,
+ y: i32,
+}
+struct WriteMessage(String); // tuple struct
+struct ChangeColorMessage(i32, i32, i32); // tuple struct
+ // ANCHOR_END: here
+
+fn main() {}
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.lock b/english/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.lock
new file mode 100644
index 0000000..f62e8ac
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "enums"
+version = "0.1.0"
+
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.toml b/english/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.toml
new file mode 100644
index 0000000..04988d1
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "enums"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/src/main.rs b/english/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/src/main.rs
new file mode 100644
index 0000000..66e0b6d
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/src/main.rs
@@ -0,0 +1,19 @@
+fn main() {
+ enum Message {
+ Quit,
+ Move { x: i32, y: i32 },
+ Write(String),
+ ChangeColor(i32, i32, i32),
+ }
+
+ // ANCHOR: here
+ impl Message {
+ fn call(&self) {
+ // method body would be defined here
+ }
+ }
+
+ let m = Message::Write(String::from("hello"));
+ m.call();
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.lock b/english/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.lock
new file mode 100644
index 0000000..f62e8ac
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "enums"
+version = "0.1.0"
+
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.toml b/english/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.toml
new file mode 100644
index 0000000..04988d1
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "enums"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/src/main.rs b/english/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/src/main.rs
new file mode 100644
index 0000000..9de5791
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/src/main.rs
@@ -0,0 +1,8 @@
+fn main() {
+ // ANCHOR: here
+ let some_number = Some(5);
+ let some_string = Some("a string");
+
+ let absent_number: Option = None;
+ // ANCHOR_END: here
+}
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.lock b/english/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.lock
new file mode 100644
index 0000000..f62e8ac
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "enums"
+version = "0.1.0"
+
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.toml b/english/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.toml
new file mode 100644
index 0000000..04988d1
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "enums"
+version = "0.1.0"
+authors = ["Your Name "]
+edition = "2018"
+
+[dependencies]
diff --git a/english/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt b/english/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt
new file mode 100644
index 0000000..856826c
--- /dev/null
+++ b/english/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt
@@ -0,0 +1,16 @@
+$ cargo run
+ Compiling enums v0.1.0 (file:///projects/enums)
+error[E0277]: cannot add `Option` to `i8`
+ --> src/main.rs:5:17
+ |
+5 | let sum = x + y;
+ | ^ no implementation for `i8 + Option`
+ |
+ = help: the trait `Add