Skip to content

Migrated editions to 2021 and fixed conflicts #1489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ title = "Rust By Example"
description = "Rust by Example (RBE) is a collection of runnable examples that illustrate various Rust concepts and standard libraries."
author = "The Rust Community"

[rust]
edition = "2021"

[output.html.playpen]
editable = true
editor = "ace"
Expand Down
2 changes: 1 addition & 1 deletion src/error/result/enter_question_mark.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The `?` operator is now recommended, but you may still find `try!` when looking
at older code. The same `multiply` function from the previous example
would look like this using `try!`:

```rust,editable
```rust,editable,edition2015
// To compile and run this example without errors, while using Cargo, change the value
// of the `edition` field, in the `[package]` section of the `Cargo.toml` file, to "2015".

Expand Down
2 changes: 1 addition & 1 deletion src/fn/closures/closure_examples/iter_any.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn main() {
// `iter()` for arrays yields `&i32`.
println!("2 in array1: {}", array1.iter() .any(|&x| x == 2));
// `into_iter()` for arrays unusually yields `&i32`.
println!("2 in array2: {}", array2.into_iter().any(|&x| x == 2));
println!("2 in array2: {}", array2.into_iter().any(| x| x == 2));
}
```

Expand Down
4 changes: 2 additions & 2 deletions src/generics/assoc_items/types.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Associated types

The use of "Associated types" improves the overall readability of code
The use of "Associated types" improves the overall readability of code
by moving inner types locally into a trait as *output* types. Syntax
for the `trait` definition is as follows:

Expand All @@ -13,7 +13,7 @@ trait Contains {
type B;

// Updated syntax to refer to these new types generically.
fn contains(&self, &Self::A, &Self::B) -> bool;
fn contains(&self, _: &Self::A, _: &Self::B) -> bool;
}
```

Expand Down