mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-10 12:49:18 +00:00
Merge branch 'main' of github.com:collin-newman/rustlings into HEAD
This commit is contained in:
commit
65f0d3fa5c
@ -2424,6 +2424,78 @@
|
|||||||
"contributions": [
|
"contributions": [
|
||||||
"content"
|
"content"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "OfirLauber",
|
||||||
|
"name": "Ofir Lauber",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/5631030?v=4",
|
||||||
|
"profile": "https://github.com/OfirLauber",
|
||||||
|
"contributions": [
|
||||||
|
"content"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "offbyone",
|
||||||
|
"name": "Chris Rose",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/181693?v=4",
|
||||||
|
"profile": "https://github.com/offbyone",
|
||||||
|
"contributions": [
|
||||||
|
"infra"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "dieterplex",
|
||||||
|
"name": "d1t2",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/507502?v=4",
|
||||||
|
"profile": "https://github.com/dieterplex",
|
||||||
|
"contributions": [
|
||||||
|
"infra"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "docwilco",
|
||||||
|
"name": "docwilco",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/66911096?v=4",
|
||||||
|
"profile": "https://github.com/docwilco",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "matthewjnield",
|
||||||
|
"name": "Matt Nield",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/64328730?v=4",
|
||||||
|
"profile": "https://www.linkedin.com/in/matthew-nield1/",
|
||||||
|
"contributions": [
|
||||||
|
"content"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "TheBearodactyl",
|
||||||
|
"name": "The Bearodactyl",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/114454115?v=4",
|
||||||
|
"profile": "https://github.com/TheBearodactyl",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "markgreene74",
|
||||||
|
"name": "markgreene74",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/18945890?v=4",
|
||||||
|
"profile": "https://github.com/markgreene74",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "VeeDeltaVee",
|
||||||
|
"name": "Versha Dhankar",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/45564258?v=4",
|
||||||
|
"profile": "https://github.com/VeeDeltaVee",
|
||||||
|
"contributions": [
|
||||||
|
"doc"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"contributorsPerLine": 8,
|
"contributorsPerLine": 8,
|
||||||
|
|||||||
4
.envrc
4
.envrc
@ -1,4 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Automatically Load nix devShell w/dotenv
|
|
||||||
use flake
|
|
||||||
10
AUTHORS.md
10
AUTHORS.md
@ -343,6 +343,16 @@ authors.
|
|||||||
<tr>
|
<tr>
|
||||||
<td align="center" valign="top" width="12.5%"><a href="https://github.com/krmpotic"><img src="https://avatars.githubusercontent.com/u/10350645?v=4?s=100" width="100px;" alt="Luka Krmpotić"/><br /><sub><b>Luka Krmpotić</b></sub></a><br /><a href="#content-krmpotic" title="Content">🖋</a></td>
|
<td align="center" valign="top" width="12.5%"><a href="https://github.com/krmpotic"><img src="https://avatars.githubusercontent.com/u/10350645?v=4?s=100" width="100px;" alt="Luka Krmpotić"/><br /><sub><b>Luka Krmpotić</b></sub></a><br /><a href="#content-krmpotic" title="Content">🖋</a></td>
|
||||||
<td align="center" valign="top" width="12.5%"><a href="https://github.com/jurglic"><img src="https://avatars.githubusercontent.com/u/112600?v=4?s=100" width="100px;" alt="Jurglic"/><br /><sub><b>Jurglic</b></sub></a><br /><a href="#content-jurglic" title="Content">🖋</a></td>
|
<td align="center" valign="top" width="12.5%"><a href="https://github.com/jurglic"><img src="https://avatars.githubusercontent.com/u/112600?v=4?s=100" width="100px;" alt="Jurglic"/><br /><sub><b>Jurglic</b></sub></a><br /><a href="#content-jurglic" title="Content">🖋</a></td>
|
||||||
|
<td align="center" valign="top" width="12.5%"><a href="https://github.com/OfirLauber"><img src="https://avatars.githubusercontent.com/u/5631030?v=4?s=100" width="100px;" alt="Ofir Lauber"/><br /><sub><b>Ofir Lauber</b></sub></a><br /><a href="#content-OfirLauber" title="Content">🖋</a></td>
|
||||||
|
<td align="center" valign="top" width="12.5%"><a href="https://github.com/offbyone"><img src="https://avatars.githubusercontent.com/u/181693?v=4?s=100" width="100px;" alt="Chris Rose"/><br /><sub><b>Chris Rose</b></sub></a><br /><a href="#infra-offbyone" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
||||||
|
<td align="center" valign="top" width="12.5%"><a href="https://github.com/dieterplex"><img src="https://avatars.githubusercontent.com/u/507502?v=4?s=100" width="100px;" alt="d1t2"/><br /><sub><b>d1t2</b></sub></a><br /><a href="#infra-dieterplex" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
||||||
|
<td align="center" valign="top" width="12.5%"><a href="https://github.com/docwilco"><img src="https://avatars.githubusercontent.com/u/66911096?v=4?s=100" width="100px;" alt="docwilco"/><br /><sub><b>docwilco</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=docwilco" title="Code">💻</a></td>
|
||||||
|
<td align="center" valign="top" width="12.5%"><a href="https://www.linkedin.com/in/matthew-nield1/"><img src="https://avatars.githubusercontent.com/u/64328730?v=4?s=100" width="100px;" alt="Matt Nield"/><br /><sub><b>Matt Nield</b></sub></a><br /><a href="#content-matthewjnield" title="Content">🖋</a></td>
|
||||||
|
<td align="center" valign="top" width="12.5%"><a href="https://github.com/TheBearodactyl"><img src="https://avatars.githubusercontent.com/u/114454115?v=4?s=100" width="100px;" alt="The Bearodactyl"/><br /><sub><b>The Bearodactyl</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=TheBearodactyl" title="Code">💻</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center" valign="top" width="12.5%"><a href="https://github.com/markgreene74"><img src="https://avatars.githubusercontent.com/u/18945890?v=4?s=100" width="100px;" alt="markgreene74"/><br /><sub><b>markgreene74</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=markgreene74" title="Code">💻</a></td>
|
||||||
|
<td align="center" valign="top" width="12.5%"><a href="https://github.com/VeeDeltaVee"><img src="https://avatars.githubusercontent.com/u/45564258?v=4?s=100" width="100px;" alt="Versha Dhankar"/><br /><sub><b>Versha Dhankar</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=VeeDeltaVee" title="Documentation">📖</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@ -25,13 +25,13 @@ You will need to have Rust installed. You can get it by visiting <https://rustup
|
|||||||
Just run:
|
Just run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | bash
|
curl -L sh.rustlings.cool | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
Or if you want it to be installed to a different path:
|
Or if you want it to be installed to a different path:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | bash -s mypath/
|
curl -L sh.rustlings.cool | bash -s mypath/
|
||||||
```
|
```
|
||||||
|
|
||||||
This will install Rustlings and give you access to the `rustlings` command. Run it to get started!
|
This will install Rustlings and give you access to the `rustlings` command. Run it to get started!
|
||||||
@ -61,7 +61,7 @@ Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|||||||
Then, you can run:
|
Then, you can run:
|
||||||
|
|
||||||
```ps1
|
```ps1
|
||||||
Start-BitsTransfer -Source https://raw.githubusercontent.com/rust-lang/rustlings/main/install.ps1 -Destination $env:TMP/install_rustlings.ps1; Unblock-File $env:TMP/install_rustlings.ps1; Invoke-Expression $env:TMP/install_rustlings.ps1
|
Start-BitsTransfer -Source https://ps1.rustlings.cool -Destination $env:TMP/install_rustlings.ps1; Unblock-File $env:TMP/install_rustlings.ps1; Invoke-Expression $env:TMP/install_rustlings.ps1
|
||||||
```
|
```
|
||||||
|
|
||||||
To install Rustlings. Same as on MacOS/Linux, you will have access to the `rustlings` command after it. Keep in mind that this works best in PowerShell, and any other terminals may give you errors.
|
To install Rustlings. Same as on MacOS/Linux, you will have access to the `rustlings` command after it. Keep in mind that this works best in PowerShell, and any other terminals may give you errors.
|
||||||
|
|||||||
@ -27,7 +27,7 @@ fn main() {
|
|||||||
println!("or logic error. The central concept behind Rustlings is to fix these errors and");
|
println!("or logic error. The central concept behind Rustlings is to fix these errors and");
|
||||||
println!("solve the exercises. Good luck!");
|
println!("solve the exercises. Good luck!");
|
||||||
println!();
|
println!();
|
||||||
println!("The source for this exercise is in `exercises/intro/intro1.rs`. Have a look!");
|
println!("The source for this exercise is in `exercises/00_intro/intro1.rs`. Have a look!");
|
||||||
println!(
|
println!(
|
||||||
"Going forward, the source of the exercises will always be in the success/failure output."
|
"Going forward, the source of the exercises will always be in the success/failure output."
|
||||||
);
|
);
|
||||||
@ -41,10 +41,9 @@ impl State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn process(&mut self, message: Message) {
|
fn process(&mut self, message: Message) {
|
||||||
// TODO: create a match expression to process the different message
|
// TODO: create a match expression to process the different message variants
|
||||||
// variants
|
// Remember: When passing a tuple as a function argument, you'll need extra parentheses:
|
||||||
// Remember: When passing a tuple as a function argument, you'll need
|
// fn function((t, u, p, l, e))
|
||||||
// extra parentheses: fn function((t, u, p, l, e))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3,7 +3,7 @@
|
|||||||
// Say we're writing a game where you can buy items with tokens. All items cost
|
// Say we're writing a game where you can buy items with tokens. All items cost
|
||||||
// 5 tokens, and whenever you purchase items there is a processing fee of 1
|
// 5 tokens, and whenever you purchase items there is a processing fee of 1
|
||||||
// token. A player of the game will type in how many items they want to buy, and
|
// token. A player of the game will type in how many items they want to buy, and
|
||||||
// the `total_cost` function will calculate the total cost of the tokens. Since
|
// the `total_cost` function will calculate the total cost of the items. Since
|
||||||
// the player typed in the quantity, though, we get it as a string-- and they
|
// the player typed in the quantity, though, we get it as a string-- and they
|
||||||
// might have typed anything, not just numbers!
|
// might have typed anything, not just numbers!
|
||||||
//
|
//
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user