Merge branch 'main' into solutions
This commit is contained in:
commit
3635c8d0bd
|
@ -591,6 +591,33 @@
|
||||||
"contributions": [
|
"contributions": [
|
||||||
"content"
|
"content"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "ryanpcmcquen",
|
||||||
|
"name": "Ryan McQuen",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/772937?v=4",
|
||||||
|
"profile": "https://ryanpcmcquen.org",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "AnnikaCodes",
|
||||||
|
"name": "Annika",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/56906084?v=4",
|
||||||
|
"profile": "https://github.com/AnnikaCodes",
|
||||||
|
"contributions": [
|
||||||
|
"review"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "darnuria",
|
||||||
|
"name": "Axel Viala",
|
||||||
|
"avatar_url": "https://avatars1.githubusercontent.com/u/2827553?v=4",
|
||||||
|
"profile": "https://darnuria.eu",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"contributorsPerLine": 8,
|
"contributorsPerLine": 8,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||

|

|
||||||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
||||||
[](#contributors-)
|
[](#contributors-)
|
||||||
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
||||||
|
|
||||||
# rustlings 🦀❤️ [](https://buildkite.com/mokou/rustlings)
|
# rustlings 🦀❤️ [](https://buildkite.com/mokou/rustlings)
|
||||||
|
@ -226,6 +226,11 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
||||||
<td align="center"><a href="https://github.com/GaurangTandon"><img src="https://avatars1.githubusercontent.com/u/6308683?v=4" width="100px;" alt=""/><br /><sub><b>Gaurang Tandon</b></sub></a><br /><a href="#content-GaurangTandon" title="Content">🖋</a></td>
|
<td align="center"><a href="https://github.com/GaurangTandon"><img src="https://avatars1.githubusercontent.com/u/6308683?v=4" width="100px;" alt=""/><br /><sub><b>Gaurang Tandon</b></sub></a><br /><a href="#content-GaurangTandon" title="Content">🖋</a></td>
|
||||||
<td align="center"><a href="https://github.com/dev-cyprium"><img src="https://avatars1.githubusercontent.com/u/6002628?v=4" width="100px;" alt=""/><br /><sub><b>Stefan Kupresak</b></sub></a><br /><a href="#content-dev-cyprium" title="Content">🖋</a></td>
|
<td align="center"><a href="https://github.com/dev-cyprium"><img src="https://avatars1.githubusercontent.com/u/6002628?v=4" width="100px;" alt=""/><br /><sub><b>Stefan Kupresak</b></sub></a><br /><a href="#content-dev-cyprium" title="Content">🖋</a></td>
|
||||||
<td align="center"><a href="https://github.com/greg-el"><img src="https://avatars3.githubusercontent.com/u/45019882?v=4" width="100px;" alt=""/><br /><sub><b>Greg Leonard</b></sub></a><br /><a href="#content-greg-el" title="Content">🖋</a></td>
|
<td align="center"><a href="https://github.com/greg-el"><img src="https://avatars3.githubusercontent.com/u/45019882?v=4" width="100px;" alt=""/><br /><sub><b>Greg Leonard</b></sub></a><br /><a href="#content-greg-el" title="Content">🖋</a></td>
|
||||||
|
<td align="center"><a href="https://ryanpcmcquen.org"><img src="https://avatars3.githubusercontent.com/u/772937?v=4" width="100px;" alt=""/><br /><sub><b>Ryan McQuen</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=ryanpcmcquen" title="Code">💻</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><a href="https://github.com/AnnikaCodes"><img src="https://avatars3.githubusercontent.com/u/56906084?v=4" width="100px;" alt=""/><br /><sub><b>Annika</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/pulls?q=is%3Apr+reviewed-by%3AAnnikaCodes" title="Reviewed Pull Requests">👀</a></td>
|
||||||
|
<td align="center"><a href="https://darnuria.eu"><img src="https://avatars1.githubusercontent.com/u/2827553?v=4" width="100px;" alt=""/><br /><sub><b>Axel Viala</b></sub></a><br /><a href="https://github.com/rust-lang/rustlings/commits?author=darnuria" title="Code">💻</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
// primitive_types6.rs
|
// primitive_types6.rs
|
||||||
// Use a tuple index to access the second element of `numbers`.
|
// Use a tuple index to access the second element of `numbers`.
|
||||||
// You can put this right into the `println!` where the ??? is.
|
// You can put the expression for the second element where ??? is so that the test passes.
|
||||||
// Execute `rustlings hint primitive_types6` for hints!
|
// Execute `rustlings hint primitive_types6` for hints!
|
||||||
|
|
||||||
|
|
||||||
fn main() {
|
#[test]
|
||||||
|
fn indexing_tuple() {
|
||||||
let numbers = (1, 2, 3);
|
let numbers = (1, 2, 3);
|
||||||
println!("The second number is {}", numbers.1);
|
println!("The second number is {}", numbers.1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,5 +21,4 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn is_false_when_even() {
|
fn is_false_when_even() {
|
||||||
assert!(!is_even(5));
|
assert!(!is_even(5));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,7 +210,7 @@ of the tuple. You can do it!!"""
|
||||||
[[exercises]]
|
[[exercises]]
|
||||||
name = "primitive_types6"
|
name = "primitive_types6"
|
||||||
path = "exercises/primitive_types/primitive_types6.rs"
|
path = "exercises/primitive_types/primitive_types6.rs"
|
||||||
mode = "compile"
|
mode = "test"
|
||||||
hint = """
|
hint = """
|
||||||
While you could use a destructuring `let` for the tuple here, try
|
While you could use a destructuring `let` for the tuple here, try
|
||||||
indexing into it instead, as explained in the last example of the
|
indexing into it instead, as explained in the last example of the
|
||||||
|
|
Loading…
Reference in a new issue