mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-12-26 00:11:49 +02:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c923e7af73 | ||
|
|
c838d446ad | ||
|
|
50323a3977 | ||
|
|
7b5ef323c5 | ||
|
|
199150fda2 | ||
|
|
c1b5a0511f | ||
|
|
742200d14b | ||
|
|
900d58d054 | ||
|
|
6af86bbf22 | ||
|
|
4c1070faab | ||
|
|
f437f8e9ea | ||
|
|
c9c743967f | ||
|
|
88c9a23884 | ||
|
|
1d5700e58a | ||
|
|
96552e07c2 | ||
|
|
c97e659d78 | ||
|
|
291da61fda | ||
|
|
94bdb708fe | ||
|
|
4910bae10f |
@@ -1542,6 +1542,33 @@
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "rzrymiak",
|
||||
"name": "rzrymiak",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/106121613?v=4",
|
||||
"profile": "https://github.com/rzrymiak",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "miguelraz",
|
||||
"name": "Miguel Raz Guzmán Macedo",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/13056181?v=4",
|
||||
"profile": "https://github.com/miguelraz",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "memark",
|
||||
"name": "Magnus Markling",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/318504?v=4",
|
||||
"profile": "https://github.com/memark",
|
||||
"contributions": [
|
||||
"content"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 8,
|
||||
|
||||
@@ -219,6 +219,11 @@ authors.
|
||||
<td align="center"><a href="http://www.gabrielbianconi.com/"><img src="https://avatars.githubusercontent.com/u/1275491?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Gabriel Bianconi</b></sub></a><br /><a href="#content-GabrielBianconi" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/Kodylow"><img src="https://avatars.githubusercontent.com/u/74332828?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kody Low</b></sub></a><br /><a href="#content-Kodylow" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/rzrymiak"><img src="https://avatars.githubusercontent.com/u/106121613?v=4?s=100" width="100px;" alt=""/><br /><sub><b>rzrymiak</b></sub></a><br /><a href="#content-rzrymiak" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/miguelraz"><img src="https://avatars.githubusercontent.com/u/13056181?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Miguel Raz Guzmán Macedo</b></sub></a><br /><a href="#content-miguelraz" title="Content">🖋</a></td>
|
||||
<td align="center"><a href="https://github.com/memark"><img src="https://avatars.githubusercontent.com/u/318504?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Magnus Markling</b></sub></a><br /><a href="#content-memark" title="Content">🖋</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
|
||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,17 @@
|
||||
<a name="5.2.1"></a>
|
||||
## 5.2.1 (2022-09-06)
|
||||
|
||||
#### Fixed
|
||||
|
||||
- **quiz1**: Reworded the comment to actually reflect what's going on in the tests.
|
||||
Also added another assert just to make sure.
|
||||
- **rc1**: Fixed a typo in the hint.
|
||||
- **lifetimes**: Add quotes to the `println!` output, for readability.
|
||||
|
||||
#### Housekeeping
|
||||
|
||||
- Fixed a typo in README.md
|
||||
|
||||
<a name="5.2.0"></a>
|
||||
## 5.2.0 (2022-08-27)
|
||||
|
||||
|
||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -459,7 +459,7 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
|
||||
|
||||
[[package]]
|
||||
name = "rustlings"
|
||||
version = "5.1.1"
|
||||
version = "5.2.1"
|
||||
dependencies = [
|
||||
"argh",
|
||||
"assert_cmd",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rustlings"
|
||||
version = "5.2.0"
|
||||
version = "5.2.1"
|
||||
authors = ["Liv <mokou@fastmail.com>", "Carol (Nichols || Goulding) <carol.nichols@gmail.com>"]
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@ If you get a permission denied message, you might have to exclude the directory
|
||||
Basically: Clone the repository at the latest tag, run `cargo install --path .`.
|
||||
|
||||
```bash
|
||||
# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 5.1.1)
|
||||
git clone -b 5.1.1 --depth 1 https://github.com/rust-lang/rustlings
|
||||
# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 5.2.1)
|
||||
git clone -b 5.2.1 --depth 1 https://github.com/rust-lang/rustlings
|
||||
cd rustlings
|
||||
cargo install --force --path .
|
||||
```
|
||||
@@ -134,7 +134,7 @@ Once you've completed Rustlings, put your new knowledge to good use! Continue pr
|
||||
|
||||
## Uninstalling Rustlings
|
||||
|
||||
If you want to remove Rustlings from your system, there's two steps. First, you'll need to remove the exercises folder that the install script created
|
||||
If you want to remove Rustlings from your system, there are two steps. First, you'll need to remove the exercises folder that the install script created
|
||||
for you:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -22,5 +22,5 @@ fn main() {
|
||||
let string2 = "xyz";
|
||||
|
||||
let result = longest(string1.as_str(), string2);
|
||||
println!("The longest string is {}", result);
|
||||
println!("The longest string is '{}'", result);
|
||||
}
|
||||
|
||||
@@ -23,5 +23,5 @@ fn main() {
|
||||
let string2 = String::from("xyz");
|
||||
result = longest(string1.as_str(), string2.as_str());
|
||||
}
|
||||
println!("The longest string is {}", result);
|
||||
println!("The longest string is '{}'", result);
|
||||
}
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
// - Functions
|
||||
// - If
|
||||
|
||||
// Mary is buying apples. One apple usually costs 2 Rustbucks, but if you buy
|
||||
// 40 or more at once, each apple only costs 1! Write a function that calculates
|
||||
// the price of an order of apples given the quantity bought. No hints this time!
|
||||
// Mary is buying apples. The price of an apple is calculated as follows:
|
||||
// - An apple costs 2 rustbucks.
|
||||
// - If Mary buys more than 40 apples, each apple only costs 1 rustbuck!
|
||||
// Write a function that calculates the price of an order of apples given
|
||||
// the quantity bought. No hints this time!
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
@@ -18,9 +20,11 @@
|
||||
fn verify_test() {
|
||||
let price1 = calculate_price_of_apples(35);
|
||||
let price2 = calculate_price_of_apples(40);
|
||||
let price3 = calculate_price_of_apples(65);
|
||||
let price3 = calculate_price_of_apples(41);
|
||||
let price4 = calculate_price_of_apples(65);
|
||||
|
||||
assert_eq!(70, price1);
|
||||
assert_eq!(80, price2);
|
||||
assert_eq!(65, price3);
|
||||
assert_eq!(41, price3);
|
||||
assert_eq!(65, price4);
|
||||
}
|
||||
|
||||
@@ -943,7 +943,7 @@ After using drop() to move the Planets out of scope individually, the reference
|
||||
In the end the sun only has one reference again, to itself. See more at:
|
||||
https://doc.rust-lang.org/book/ch15-04-rc.html
|
||||
|
||||
* Unforunately Pluto is no longer considered a planet :(
|
||||
* Unfortunately Pluto is no longer considered a planet :(
|
||||
"""
|
||||
|
||||
[[exercises]]
|
||||
|
||||
@@ -26,7 +26,7 @@ mod run;
|
||||
mod verify;
|
||||
|
||||
// In sync with crate version
|
||||
const VERSION: &str = "5.2.0";
|
||||
const VERSION: &str = "5.2.1";
|
||||
|
||||
#[derive(FromArgs, PartialEq, Debug)]
|
||||
/// Rustlings is a collection of small exercises to get you used to writing and reading Rust code
|
||||
|
||||
Reference in New Issue
Block a user