Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ authors = [
]
repository = "https://github.com/rust-lang/rustlings"
license = "MIT"
edition = "2024" # On Update: Update the edition of the `rustfmt` command that checks the solutions.
edition = "2024" # On Update: Update the edition of `rustfmt` in `dev check` and `CARGO_TOML` in `dev new`.
rust-version = "1.85"

[workspace.dependencies]
Expand Down
6 changes: 1 addition & 5 deletions solutions/03_if/if1.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
fn bigger(a: i32, b: i32) -> i32 {
if a > b {
a
} else {
b
}
if a > b { a } else { b }
}

fn main() {
Expand Down
8 changes: 5 additions & 3 deletions solutions/11_hashmaps/hashmaps3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ England,Spain,1,0";
fn build_scores() {
let scores = build_scores_table(RESULTS);

assert!(["England", "France", "Germany", "Italy", "Poland", "Spain"]
.into_iter()
.all(|team_name| scores.contains_key(team_name)));
assert!(
["England", "France", "Germany", "Italy", "Poland", "Spain"]
.into_iter()
.all(|team_name| scores.contains_key(team_name))
);
}

#[test]
Expand Down
6 changes: 1 addition & 5 deletions solutions/16_lifetimes/lifetimes1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@

fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
// ^^^^ ^^ ^^ ^^
if x.len() > y.len() {
x
} else {
y
}
if x.len() > y.len() { x } else { y }
}

fn main() {
Expand Down
6 changes: 1 addition & 5 deletions solutions/16_lifetimes/lifetimes2.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
if x.len() > y.len() {
x
} else {
y
}
if x.len() > y.len() { x } else { y }
}

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion solutions/quizzes/quiz2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ mod tests {
// Import `transformer`.
use super::my_module::transformer;

use super::my_module::transformer_iter;
use super::Command;
use super::my_module::transformer_iter;

#[test]
fn it_works() {
Expand Down
2 changes: 1 addition & 1 deletion src/dev/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ fn check_solutions(
fmt_cmd
.arg("--check")
.arg("--edition")
.arg("2021")
.arg("2024")
.arg("--color")
.arg("always")
.stdin(Stdio::null());
Expand Down
Loading