Compare commits

...

10 commits

Author SHA1 Message Date
mo8it 981a4778a9 Add newline between functions 2024-07-06 22:23:19 +02:00
mo8it 5d4363d58d Add comma 2024-07-06 22:22:52 +02:00
Mo 48697b8225
Merge pull request #2027 from yerke/patch-2
Fix formatting in strings4.rs
2024-07-06 22:22:27 +02:00
Mo 1652bb67d9
Merge pull request #2026 from yerke/patch-1
Fix typo in structs3.rs
2024-07-06 22:21:15 +02:00
Yerkebulan Tulibergenov 1499f681a3
Fix formatting in strings4.rs 2024-07-06 12:53:14 -07:00
Yerkebulan Tulibergenov a21fa6ff40
Fix typo in structs3.rs 2024-07-06 12:37:55 -07:00
Mo 186dc3c1ab
Merge pull request #2025 from mre/patch-1
Fix typo in `THIRD_PARTY_EXERCISES.md`
2024-07-06 17:06:03 +02:00
Matthias Endler 6b7a27d080
Fix typo in THIRD_PARTY_EXERCISES.md 2024-07-06 14:30:11 +02:00
Mo c9017f9f7a
Merge pull request #2022 from matthewjnield/main
chore: Update errors5.rs exercise to be consistent with solution
2024-07-06 13:25:03 +02:00
Matt Nield fdada8b3d4
chore: Update errors5.rs exercise to be consistent with solution
In errors5.rs, there are two lines of a pattern matching block for which the order is reversed between the exercise file and the solution file. Since these lines are not changed as part of the exercise, this commit updates the exercise to make the order of the lines consistent with the solution, so that users will focus only on the lines that change between the exercise and the solution.
2024-07-05 16:04:07 -04:00
5 changed files with 6 additions and 4 deletions

View file

@ -1,7 +1,7 @@
# Third-Party Exercises
The support of Rustlings for third-party exercises allows you to create your own set of Rustlings exercises to focus on some specific topic.
You could also offer a translatation of the original Rustlings exercises as third-party exercises.
You could also offer a translation of the original Rustlings exercises as third-party exercises.
## Getting started

View file

@ -1,5 +1,5 @@
// Structs contain data, but can also have logic. In this exercise we have
// defined the `Package` struct and we want to test some logic attached to it.
// Structs contain data, but can also have logic. In this exercise, we have
// defined the `Package` struct, and we want to test some logic attached to it.
#[derive(Debug)]
struct Package {

View file

@ -4,6 +4,7 @@ fn placeholder() {}
fn string_slice(arg: &str) {
println!("{arg}");
}
fn string(arg: String) {
println!("{arg}");
}

View file

@ -39,8 +39,8 @@ struct PositiveNonzeroInteger(u64);
impl PositiveNonzeroInteger {
fn new(value: i64) -> Result<PositiveNonzeroInteger, CreationError> {
match value {
0 => Err(CreationError::Zero),
x if x < 0 => Err(CreationError::Negative),
0 => Err(CreationError::Zero),
x => Ok(PositiveNonzeroInteger(x as u64)),
}
}

View file

@ -1,6 +1,7 @@
fn string_slice(arg: &str) {
println!("{arg}");
}
fn string(arg: String) {
println!("{arg}");
}