mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-01-15 00:00:03 +03:00
Compare commits
No commits in common. "981a4778a9e452d143e9542a1eb8c8a60644c003" and "9e2ff7d037a3c72ccedb7818350e98baca445506" have entirely different histories.
981a4778a9
...
9e2ff7d037
|
@ -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 translation of the original Rustlings exercises as third-party exercises.
|
||||
You could also offer a translatation of the original Rustlings exercises as third-party exercises.
|
||||
|
||||
## Getting started
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -4,7 +4,6 @@ fn placeholder() {}
|
|||
fn string_slice(arg: &str) {
|
||||
println!("{arg}");
|
||||
}
|
||||
|
||||
fn string(arg: String) {
|
||||
println!("{arg}");
|
||||
}
|
||||
|
|
|
@ -39,8 +39,8 @@ struct PositiveNonzeroInteger(u64);
|
|||
impl PositiveNonzeroInteger {
|
||||
fn new(value: i64) -> Result<PositiveNonzeroInteger, CreationError> {
|
||||
match value {
|
||||
x if x < 0 => Err(CreationError::Negative),
|
||||
0 => Err(CreationError::Zero),
|
||||
x if x < 0 => Err(CreationError::Negative),
|
||||
x => Ok(PositiveNonzeroInteger(x as u64)),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
fn string_slice(arg: &str) {
|
||||
println!("{arg}");
|
||||
}
|
||||
|
||||
fn string(arg: String) {
|
||||
println!("{arg}");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue