Skip to content

Commit 06ca7b8

Browse files
authored
Merge pull request rust-lang#2393 from foxfromworld/issue-2023-rename-exercises
Apply Option A naming for smart_pointers and conversions exercises
2 parents e38c82c + ef99b5c commit 06ca7b8

21 files changed

Lines changed: 31 additions & 31 deletions

dev/Cargo.toml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,14 @@ bin = [
150150
{ name = "iterators4_sol", path = "../solutions/18_iterators/iterators4.rs" },
151151
{ name = "iterators5", path = "../exercises/18_iterators/iterators5.rs" },
152152
{ name = "iterators5_sol", path = "../solutions/18_iterators/iterators5.rs" },
153-
{ name = "box1", path = "../exercises/19_smart_pointers/box1.rs" },
154-
{ name = "box1_sol", path = "../solutions/19_smart_pointers/box1.rs" },
155-
{ name = "rc1", path = "../exercises/19_smart_pointers/rc1.rs" },
156-
{ name = "rc1_sol", path = "../solutions/19_smart_pointers/rc1.rs" },
157-
{ name = "arc1", path = "../exercises/19_smart_pointers/arc1.rs" },
158-
{ name = "arc1_sol", path = "../solutions/19_smart_pointers/arc1.rs" },
159-
{ name = "cow1", path = "../exercises/19_smart_pointers/cow1.rs" },
160-
{ name = "cow1_sol", path = "../solutions/19_smart_pointers/cow1.rs" },
153+
{ name = "smart_pointers1", path = "../exercises/19_smart_pointers/smart_pointers1.rs" },
154+
{ name = "smart_pointers1_sol", path = "../solutions/19_smart_pointers/smart_pointers1.rs" },
155+
{ name = "smart_pointers2", path = "../exercises/19_smart_pointers/smart_pointers2.rs" },
156+
{ name = "smart_pointers2_sol", path = "../solutions/19_smart_pointers/smart_pointers2.rs" },
157+
{ name = "smart_pointers3", path = "../exercises/19_smart_pointers/smart_pointers3.rs" },
158+
{ name = "smart_pointers3_sol", path = "../solutions/19_smart_pointers/smart_pointers3.rs" },
159+
{ name = "smart_pointers4", path = "../exercises/19_smart_pointers/smart_pointers4.rs" },
160+
{ name = "smart_pointers4_sol", path = "../solutions/19_smart_pointers/smart_pointers4.rs" },
161161
{ name = "threads1", path = "../exercises/20_threads/threads1.rs" },
162162
{ name = "threads1_sol", path = "../solutions/20_threads/threads1.rs" },
163163
{ name = "threads2", path = "../exercises/20_threads/threads2.rs" },
@@ -178,16 +178,16 @@ bin = [
178178
{ name = "clippy2_sol", path = "../solutions/22_clippy/clippy2.rs" },
179179
{ name = "clippy3", path = "../exercises/22_clippy/clippy3.rs" },
180180
{ name = "clippy3_sol", path = "../solutions/22_clippy/clippy3.rs" },
181-
{ name = "using_as", path = "../exercises/23_conversions/using_as.rs" },
182-
{ name = "using_as_sol", path = "../solutions/23_conversions/using_as.rs" },
183-
{ name = "from_into", path = "../exercises/23_conversions/from_into.rs" },
184-
{ name = "from_into_sol", path = "../solutions/23_conversions/from_into.rs" },
185-
{ name = "from_str", path = "../exercises/23_conversions/from_str.rs" },
186-
{ name = "from_str_sol", path = "../solutions/23_conversions/from_str.rs" },
187-
{ name = "try_from_into", path = "../exercises/23_conversions/try_from_into.rs" },
188-
{ name = "try_from_into_sol", path = "../solutions/23_conversions/try_from_into.rs" },
189-
{ name = "as_ref_mut", path = "../exercises/23_conversions/as_ref_mut.rs" },
190-
{ name = "as_ref_mut_sol", path = "../solutions/23_conversions/as_ref_mut.rs" },
181+
{ name = "conversions1", path = "../exercises/23_conversions/conversions1.rs" },
182+
{ name = "conversions1_sol", path = "../solutions/23_conversions/conversions1.rs" },
183+
{ name = "conversions2", path = "../exercises/23_conversions/conversions2.rs" },
184+
{ name = "conversions2_sol", path = "../solutions/23_conversions/conversions2.rs" },
185+
{ name = "conversions3", path = "../exercises/23_conversions/conversions3.rs" },
186+
{ name = "conversions3_sol", path = "../solutions/23_conversions/conversions3.rs" },
187+
{ name = "conversions4", path = "../exercises/23_conversions/conversions4.rs" },
188+
{ name = "conversions4_sol", path = "../solutions/23_conversions/conversions4.rs" },
189+
{ name = "conversions5", path = "../exercises/23_conversions/conversions5.rs" },
190+
{ name = "conversions5_sol", path = "../solutions/23_conversions/conversions5.rs" },
191191
]
192192

193193
[package]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

exercises/23_conversions/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
Rust offers a multitude of ways to convert a value of a given type into another type.
44

5-
The simplest form of type conversion is a type cast expression. It is denoted with the binary operator `as`. For instance, `println!("{}", 1 + 1.0);` would not compile, since `1` is an integer while `1.0` is a float. However, `println!("{}", 1 as f32 + 1.0)` should compile. The exercise [`using_as`](using_as.rs) tries to cover this.
5+
The simplest form of type conversion is a type cast expression. It is denoted with the binary operator `as`. For instance, `println!("{}", 1 + 1.0);` would not compile, since `1` is an integer while `1.0` is a float. However, `println!("{}", 1 as f32 + 1.0)` should compile. The exercise [`conversions1`](conversions1.rs) tries to cover this.
66

77
Rust also offers traits that facilitate type conversions upon implementation. These traits can be found under the [`convert`](https://doc.rust-lang.org/std/convert/index.html) module.
88
The traits are the following:
99

10-
- `From` and `Into` covered in [`from_into`](from_into.rs)
11-
- `TryFrom` and `TryInto` covered in [`try_from_into`](try_from_into.rs)
12-
- `AsRef` and `AsMut` covered in [`as_ref_mut`](as_ref_mut.rs)
10+
- `From` and `Into` covered in [`conversions2`](conversions2.rs)
11+
- `TryFrom` and `TryInto` covered in [`conversions4`](conversions4.rs)
12+
- `AsRef` and `AsMut` covered in [`conversions5`](conversions5.rs)
1313

1414
Furthermore, the `std::str` module offers a trait called [`FromStr`](https://doc.rust-lang.org/std/str/trait.FromStr.html) which helps with converting strings into target types via the `parse` method on strings. If properly implemented for a given type `Person`, then `let p: Person = "Mark,20".parse().unwrap()` should both compile and run without panicking.
1515

0 commit comments

Comments
 (0)