Compare commits

...

52 commits

Author SHA1 Message Date
liv 76acf613c5
Merge branch 'main' into main 2024-03-15 14:36:23 +01:00
liv 2966a29449
Merge pull request #1892 from rust-lang/all-contributors/add-luvchurchill
docs: add luvchurchill as a contributor for code
2024-03-15 14:35:29 +01:00
allcontributors[bot] c01ddbc747
docs: update .all-contributorsrc [skip ci] 2024-03-15 13:35:17 +00:00
allcontributors[bot] f8f627b6f7
docs: update AUTHORS.md [skip ci] 2024-03-15 13:35:16 +00:00
liv c3f1183815
Merge pull request #1850 from luvchurchill/main
Fix(Installation) Added .git to end of Repo's https URL
2024-03-15 14:34:48 +01:00
liv f08fd02f33
Merge pull request #1891 from rust-lang/all-contributors/add-evanmiller2112
docs: add evanmiller2112 as a contributor for content
2024-03-15 14:32:52 +01:00
allcontributors[bot] 8d1258f26a
docs: update .all-contributorsrc [skip ci] 2024-03-15 13:32:31 +00:00
allcontributors[bot] 4304b3981e
docs: update AUTHORS.md [skip ci] 2024-03-15 13:32:30 +00:00
liv 31e7920cee
Merge pull request #1869 from evanmiller2112/main
Clarify language in hashmap3.rs (sum vs per match)
2024-03-15 14:32:12 +01:00
liv 6fb45305f8
Merge pull request #1890 from rust-lang/all-contributors/add-hyphena
docs: add hyphena as a contributor for content
2024-03-15 14:29:00 +01:00
allcontributors[bot] 9cf5a2f83f
docs: update .all-contributorsrc [skip ci] 2024-03-15 13:22:14 +00:00
allcontributors[bot] 3d6b5e8102
docs: update AUTHORS.md [skip ci] 2024-03-15 13:22:13 +00:00
liv 8c5d091513
Merge pull request #1875 from hyphena/patch-1
chore: minor typo fix
2024-03-15 14:21:56 +01:00
liv 91df875847
Merge pull request #1889 from rust-lang/all-contributors/add-pavedroad
docs: add pavedroad as a contributor for content
2024-03-15 14:21:36 +01:00
allcontributors[bot] 1ac392a551
docs: update .all-contributorsrc [skip ci] 2024-03-15 13:19:34 +00:00
allcontributors[bot] 3f0dc81a9c
docs: update AUTHORS.md [skip ci] 2024-03-15 13:19:33 +00:00
liv 44ef58be43
Merge pull request #1881 from pavedroad/main
chore: fix typo
2024-03-15 14:19:17 +01:00
liv 803e0a4fbb
Merge pull request #1888 from rust-lang/all-contributors/add-kylev
docs: add kylev as a contributor for infra
2024-03-15 14:17:26 +01:00
allcontributors[bot] 62b435a309
docs: update .all-contributorsrc [skip ci] 2024-03-15 13:17:18 +00:00
allcontributors[bot] fe28feba1e
docs: update AUTHORS.md [skip ci] 2024-03-15 13:17:17 +00:00
liv cc27966980
Merge pull request #1877 from kylev/kv_faster_devcon
Simplify and shrink development container
2024-03-15 14:17:00 +01:00
liv 6b0a2ff0d0
Merge pull request #1871 from rust-lang/dependabot/cargo/mio-0.8.11
chore(deps): bump mio from 0.8.9 to 0.8.11
2024-03-15 14:15:04 +01:00
liv b0c50b3bc7
Merge pull request #1887 from rust-lang/all-contributors/add-JanB1
docs: add JanB1 as a contributor for content
2024-03-15 14:02:17 +01:00
allcontributors[bot] 4c51cb0909
docs: update .all-contributorsrc [skip ci] 2024-03-15 13:02:10 +00:00
allcontributors[bot] 032e3c9f30
docs: update AUTHORS.md [skip ci] 2024-03-15 13:02:09 +00:00
liv 9bae712453
Merge pull request #1856 from JanB1/main
Clarified hint text
2024-03-15 14:01:54 +01:00
liv b057e09156
Merge pull request #1886 from rust-lang/all-contributors/add-peterneave
docs: add peterneave as a contributor for infra
2024-03-15 13:57:03 +01:00
allcontributors[bot] 0d5c105c15
docs: update .all-contributorsrc [skip ci] 2024-03-15 12:56:53 +00:00
allcontributors[bot] fe698d9096
docs: update AUTHORS.md [skip ci] 2024-03-15 12:56:52 +00:00
liv c54ec23b9e
Merge pull request #1837 from peterneave/main
fix: Ensure scripts have LF line endings
2024-03-15 13:56:35 +01:00
liv 6f1d309308
Merge pull request #1885 from rust-lang/all-contributors/add-reifenrath-dev
docs: add reifenrath-dev as a contributor for content
2024-03-15 13:53:11 +01:00
allcontributors[bot] 6f88dd437e
docs: update .all-contributorsrc [skip ci] 2024-03-15 12:52:54 +00:00
allcontributors[bot] 557bbe2b85
docs: update AUTHORS.md [skip ci] 2024-03-15 12:52:53 +00:00
liv 32c19c2e47
Merge pull request #1832 from reifenrath-dev/main
chore: update from_into.rs task description to fit the code
2024-03-15 13:52:38 +01:00
liv 27d1a31eb6
Merge pull request #1884 from rust-lang/all-contributors/add-AnonimAnonim2245
docs: add AnonimAnonim2245 as a contributor for code
2024-03-15 13:52:01 +01:00
allcontributors[bot] 3c6c29e19e
docs: update .all-contributorsrc [skip ci] 2024-03-15 12:51:44 +00:00
allcontributors[bot] 2b97faa1d3
docs: update AUTHORS.md [skip ci] 2024-03-15 12:51:43 +00:00
Luca Plian 17ee0e3c7a
optimized the UI code (#1830) 2024-03-15 13:51:24 +01:00
liv c46a711526 fix: revert from_into test change 2024-03-15 13:48:57 +01:00
pavedroad f5e9db90cc chore: fix typo
Signed-off-by: pavedroad <qcqs@outlook.com>
2024-03-12 14:35:48 +08:00
Kyle VanderBeek 2fb135026c Add back the post-attach watch. 2024-03-09 23:18:31 +00:00
Kyle VanderBeek 77903200a0 Remove duplicate vscode extension list.
It's already in the vendor-specific .vscode files.
2024-03-09 20:20:14 +00:00
Kyle VanderBeek e424e9f6c7 Add target directory to $PATH
Makes the pre-built command work in the shell right away.
2024-03-09 20:07:51 +00:00
Kyle VanderBeek 11f0fd7fd9 Convert to lightweight dev container; simplify.
Instead of running `rustup` on a multi-gigabyte general-purpose Linux base, use the premade devcontainers/rust:1 which closely tracks the rust toolchain releases. Rip out excess setup steps since devcontainers come with the repo checked out; just compile/update the binary.
2024-03-09 19:45:50 +00:00
luna 547f3ac835
chore: minor typo fix 2024-03-07 18:31:33 -05:00
dependabot[bot] 373676a576
chore(deps): bump mio from 0.8.9 to 0.8.11
Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.9 to 0.8.11.
- [Release notes](https://github.com/tokio-rs/mio/releases)
- [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/mio/compare/v0.8.9...v0.8.11)

---
updated-dependencies:
- dependency-name: mio
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 22:02:08 +00:00
Evan Miller 9bda8598e1
Merge pull request #1 from evanmiller2112/evanmiller2112-hashmap3-description
Update hashmaps3.rs description for clarity
2024-03-04 10:39:01 -05:00
Evan Miller 19b5e24d5c
Update hashmaps3.rs description for clarity
I struggled with this exercise and didn't understand that it was looking for a summary of goals scored/conceded per team, instead of per match.

My goal here is just to clarify the language, essentially saying "the total number of goals the team scored" to indicate that we are looking for a sum.

Updated the exercise description to clarify this point.

Relates loosely to closed issue https://github.com/rust-lang/rustlings/issues/1361
2024-03-04 10:38:09 -05:00
Jan 75ee0e4245
Clarified hint text 2024-02-12 18:13:20 +01:00
luvchurchill 53c40024d8
Added .git to end of Repo's https URL
The install.sh script didn't work for me, after I changed this locally it worked
URL needs to end in .git
2024-02-06 01:54:04 +02:00
Peter Neave 6072ec16a0 fix: Ensure scripts have LF line endings
Use gitattributes file to ensure script files have LF line endings. This solves a problem for users who wish to use DevContainers on Windows machines and the file has been cloned from the repository with CRLF line endings.
2024-01-24 09:30:49 +11:00
reifenrath-dev b70ed105db chore: update from_into.rs task description to fit the code 2024-01-19 11:18:54 +01:00
12 changed files with 131 additions and 57 deletions

View file

@ -2559,6 +2559,87 @@
"contributions": [
"content"
]
},
{
"login": "AnonimAnonim2245",
"name": "Luca Plian",
"avatar_url": "https://avatars.githubusercontent.com/u/98339220?v=4",
"profile": "https://github.com/AnonimAnonim2245",
"contributions": [
"code"
]
},
{
"login": "reifenrath-dev",
"name": "René Reifenrath",
"avatar_url": "https://avatars.githubusercontent.com/u/18126097?v=4",
"profile": "https://reifenrath.dev/",
"contributions": [
"content"
]
},
{
"login": "peterneave",
"name": "Peter Neave",
"avatar_url": "https://avatars.githubusercontent.com/u/7982708?v=4",
"profile": "https://github.com/peterneave",
"contributions": [
"infra"
]
},
{
"login": "JanB1",
"name": "Jan",
"avatar_url": "https://avatars.githubusercontent.com/u/5552248?v=4",
"profile": "http://www.janb1.com",
"contributions": [
"content"
]
},
{
"login": "kylev",
"name": "Kyle VanderBeek",
"avatar_url": "https://avatars.githubusercontent.com/u/46888?v=4",
"profile": "http://www.kylev.com/",
"contributions": [
"infra"
]
},
{
"login": "pavedroad",
"name": "pavedroad",
"avatar_url": "https://avatars.githubusercontent.com/u/138004431?v=4",
"profile": "https://github.com/pavedroad",
"contributions": [
"content"
]
},
{
"login": "hyphena",
"name": "luna",
"avatar_url": "https://avatars.githubusercontent.com/u/26529488?v=4",
"profile": "https://github.com/hyphena",
"contributions": [
"content"
]
},
{
"login": "evanmiller2112",
"name": "Evan Miller",
"avatar_url": "https://avatars.githubusercontent.com/u/28488957?v=4",
"profile": "https://github.com/evanmiller2112",
"contributions": [
"content"
]
},
{
"login": "luvchurchill",
"name": "luvchurchill",
"avatar_url": "https://avatars.githubusercontent.com/u/46406654?v=4",
"profile": "https://github.com/luvchurchill",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 8,

View file

@ -1,17 +1,8 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2-linux",
"waitFor": "onCreateCommand",
"onCreateCommand": ".devcontainer/setup.sh",
"updateContentCommand": "cargo build",
"postCreateCommand": "",
"postAttachCommand": {
"server": "rustlings watch"
},
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer"
]
}
"image": "mcr.microsoft.com/devcontainers/rust:1",
"updateContentCommand": ["cargo", "build"],
"postAttachCommand": ["rustlings", "watch"],
"remoteEnv": {
"PATH": "${containerEnv:PATH}:${containerWorkspaceFolder}/target/debug"
}
}

View file

@ -1,7 +0,0 @@
#!/bin/bash
curl https://sh.rustup.rs -sSf | sh -s -- -y
# Update current shell environment variables after install to find rustup
. "$HOME/.cargo/env"
rustup install stable
bash install.sh

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
* text=auto
*.sh text eol=lf

View file

@ -362,6 +362,17 @@ authors.
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/gerases"><img src="https://avatars.githubusercontent.com/u/8953623?v=4?s=100" width="100px;" alt="gerases"/><br /><sub><b>gerases</b></sub></a><br /><a href="#content-gerases" title="Content">🖋</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/AnonimAnonim2245"><img src="https://avatars.githubusercontent.com/u/98339220?v=4?s=100" width="100px;" alt="Luca Plian"/><br /><sub><b>Luca Plian</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=AnonimAnonim2245" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://reifenrath.dev/"><img src="https://avatars.githubusercontent.com/u/18126097?v=4?s=100" width="100px;" alt="René Reifenrath"/><br /><sub><b>René Reifenrath</b></sub></a><br /><a href="#content-reifenrath-dev" title="Content">🖋</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/peterneave"><img src="https://avatars.githubusercontent.com/u/7982708?v=4?s=100" width="100px;" alt="Peter Neave"/><br /><sub><b>Peter Neave</b></sub></a><br /><a href="#infra-peterneave" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="12.5%"><a href="http://www.janb1.com"><img src="https://avatars.githubusercontent.com/u/5552248?v=4?s=100" width="100px;" alt="Jan"/><br /><sub><b>Jan</b></sub></a><br /><a href="#content-JanB1" title="Content">🖋</a></td>
<td align="center" valign="top" width="12.5%"><a href="http://www.kylev.com/"><img src="https://avatars.githubusercontent.com/u/46888?v=4?s=100" width="100px;" alt="Kyle VanderBeek"/><br /><sub><b>Kyle VanderBeek</b></sub></a><br /><a href="#infra-kylev" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/pavedroad"><img src="https://avatars.githubusercontent.com/u/138004431?v=4?s=100" width="100px;" alt="pavedroad"/><br /><sub><b>pavedroad</b></sub></a><br /><a href="#content-pavedroad" title="Content">🖋</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/hyphena"><img src="https://avatars.githubusercontent.com/u/26529488?v=4?s=100" width="100px;" alt="luna"/><br /><sub><b>luna</b></sub></a><br /><a href="#content-hyphena" title="Content">🖋</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/evanmiller2112"><img src="https://avatars.githubusercontent.com/u/28488957?v=4?s=100" width="100px;" alt="Evan Miller"/><br /><sub><b>Evan Miller</b></sub></a><br /><a href="#content-evanmiller2112" title="Content">🖋</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/luvchurchill"><img src="https://avatars.githubusercontent.com/u/46406654?v=4?s=100" width="100px;" alt="luvchurchill"/><br /><sub><b>luvchurchill</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=luvchurchill" title="Code">💻</a></td>
</tr>
</tbody>
</table>

View file

@ -167,7 +167,7 @@
- **structs3**: Clarifed the hint
- **quiz2, as_ref_mut, options1, traits1, traits2**: Clarified hints
- **traits1, traits2, cli**: Tidied up unmatching backticks
- **enums2**: Removed unneccessary indirection of self
- **enums2**: Removed unnecessary indirection of self
- **enums3**: Added an extra tuple comment
#### Housekeeping

4
Cargo.lock generated
View file

@ -390,9 +390,9 @@ checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c"
[[package]]
name = "mio"
version = "0.8.9"
version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0"
checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
dependencies = [
"libc",
"log",

View file

@ -4,10 +4,11 @@
// the form : "<team_1_name>,<team_2_name>,<team_1_goals>,<team_2_goals>"
// Example: England,France,4,2 (England scored 4 goals, France 2).
//
// You have to build a scores table containing the name of the team, goals the
// team scored, and goals the team conceded. One approach to build the scores
// table is to use a Hashmap. The solution is partially written to use a
// Hashmap, complete it to pass the test.
// You have to build a scores table containing the name of the team, the total
// number of goals the team scored, and the total number of goals the team
// conceded. One approach to build the scores table is to use a Hashmap.
// The solution is partially written to use a Hashmap,
// complete it to pass the test.
//
// Make me pass the tests!
//

View file

@ -24,7 +24,8 @@ impl Default for Person {
}
}
// Your task is to complete this implementation in order for the line `let p =
// Your task is to complete this implementation in order for the line `let p1 =
// Person::from("Mark,20")` to compile. Please note that you'll need to parse the
// age component into a `usize` with something like `"4".parse::<usize>()`. The
// outcome of this needs to be handled appropriately.
@ -43,8 +44,7 @@ impl Default for Person {
// I AM NOT DONE
impl From<&str> for Person {
fn from(s: &str) -> Person {
}
fn from(s: &str) -> Person {}
}
fn main() {
@ -127,14 +127,14 @@ mod tests {
#[test]
fn test_trailing_comma() {
let p: Person = Person::from("Mike,32,");
assert_eq!(p.name, "Mike");
assert_eq!(p.age, 32);
assert_eq!(p.name, "John");
assert_eq!(p.age, 30);
}
#[test]
fn test_trailing_comma_and_some_string() {
let p: Person = Person::from("Mike,32,man");
assert_eq!(p.name, "Mike");
assert_eq!(p.age, 32);
let p: Person = Person::from("Mike,32,dog");
assert_eq!(p.name, "John");
assert_eq!(p.age, 30);
}
}

View file

@ -145,7 +145,7 @@ after the `->`. This is where the function's return type should be -- take a
look at the `is_even` function for an example!
Also: Did you figure out that, technically, `u32` would be the more fitting type
for the prices here, since they can't be negative? If so, kudos!"""
for the inputs of the functions here, since the original prices shouldn't be negative? If so, kudos!"""
[[exercises]]
name = "functions5"
@ -248,7 +248,7 @@ starting and ending (plus one) indices of the items in the `Array` that you
want to end up in the slice.
If you're curious why the first argument of `assert_eq!` does not have an
ampersand for a reference since the second argument is areference, take a look
ampersand for a reference since the second argument is a reference, take a look
at the coercion chapter of the nomicon:
https://doc.rust-lang.org/nomicon/coercions.html"""

View file

@ -137,7 +137,7 @@ fi
Path=${1:-rustlings/}
echo "Cloning Rustlings at $Path..."
git clone -q https://github.com/rust-lang/rustlings "$Path"
git clone -q https://github.com/rust-lang/rustlings.git "$Path"
cd "$Path"

View file

@ -1,33 +1,28 @@
macro_rules! warn {
($fmt:literal, $ex:expr) => {{
macro_rules! print_emoji {
($emoji:expr, $sign:expr, $color: ident ,$fmt:literal, $ex:expr) => {{
use console::{style, Emoji};
use std::env;
let formatstr = format!($fmt, $ex);
if env::var("NO_EMOJI").is_ok() {
println!("{} {}", style("!").red(), style(formatstr).red());
println!("{} {}", style($sign).$color(), style(formatstr).$color());
} else {
println!(
"{} {}",
style(Emoji("⚠️ ", "!")).red(),
style(formatstr).red()
style(Emoji($emoji, $sign)).$color(),
style(formatstr).$color()
);
}
}};
}
macro_rules! success {
macro_rules! warn {
($fmt:literal, $ex:expr) => {{
use console::{style, Emoji};
use std::env;
let formatstr = format!($fmt, $ex);
if env::var("NO_EMOJI").is_ok() {
println!("{} {}", style("").green(), style(formatstr).green());
} else {
println!(
"{} {}",
style(Emoji("", "")).green(),
style(formatstr).green()
);
}
print_emoji!("⚠️ ", "!", red, $fmt, $ex);
}};
}
macro_rules! success {
($fmt:literal, $ex:expr) => {{
print_emoji!("", "", green, $fmt, $ex);
}};
}