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: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
dev = ["run", "--", "dev"]
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Changed

- Upgrade to Rust edition 2024
- Raise the minimum supported Rust version to `1.85`
- Raise the minimum supported Rust version to `1.87`

<a name="6.4.0"></a>

Expand Down
33 changes: 11 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ authors = [
repository = "https://github.com/rust-lang/rustlings"
license = "MIT"
edition = "2024" # On Update: Update the edition of `rustfmt` in `dev check` and `CARGO_TOML` in `dev new`.
rust-version = "1.85"
rust-version = "1.87"

[workspace.dependencies]
serde = { version = "1.0", features = ["derive"] }
Expand Down Expand Up @@ -50,7 +50,6 @@ anyhow = "1.0"
clap = { version = "4.5", features = ["derive"] }
crossterm = { version = "0.29", default-features = false, features = ["windows", "events"] }
notify = "8.0"
os_pipe = "1.2"
rustlings-macros = { path = "rustlings-macros", version = "=6.4.0" }
serde_json = "1.0"
serde.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion dev/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Don't edit the `bin` list manually! It is updated by `cargo run -- dev update`. This comment line will be stripped in `rustlings init`.
# Don't edit the `bin` list manually! It is updated by `cargo dev update`. This comment line will be stripped in `rustlings init`.
bin = [
{ name = "intro1", path = "../exercises/00_intro/intro1.rs" },
{ name = "intro1_sol", path = "../solutions/00_intro/intro1.rs" },
Expand Down
3 changes: 3 additions & 0 deletions oranda.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"build": {
"path_prefix": "rustlings"
},
"project": {
"homepage": "https://rustlings.cool",
"repository": "https://github.com/rust-lang/rustlings"
Expand Down
4 changes: 2 additions & 2 deletions src/cmd.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::{Context, Result, bail};
use serde::Deserialize;
use std::{
io::Read,
io::{Read, pipe},
path::PathBuf,
process::{Command, Stdio},
};
Expand All @@ -17,7 +17,7 @@ fn run_cmd(mut cmd: Command, description: &str, output: Option<&mut Vec<u8>>) ->
};

let mut handle = if let Some(output) = output {
let (mut reader, writer) = os_pipe::pipe().with_context(|| {
let (mut reader, writer) = pipe().with_context(|| {
format!("Failed to create a pipe to run the command `{description}``")
})?;

Expand Down
4 changes: 2 additions & 2 deletions src/dev/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn check_cargo_toml(
if old_bins != new_bins {
if cfg!(debug_assertions) {
bail!(
"The file `dev/Cargo.toml` is outdated. Run `cargo run -- dev update` to update it. Then run `cargo run -- dev check` again"
"The file `dev/Cargo.toml` is outdated. Run `cargo dev update` to update it. Then run `cargo run -- dev check` again"
);
}

Expand Down Expand Up @@ -379,7 +379,7 @@ pub fn check(require_solutions: bool) -> Result<()> {
}

if cfg!(debug_assertions) {
// A hack to make `cargo run -- dev check` work when developing Rustlings.
// A hack to make `cargo dev check` work when developing Rustlings.
check_cargo_toml(&info_file.exercises, "dev/Cargo.toml", b"../")?;
} else {
check_cargo_toml(&info_file.exercises, "Cargo.toml", b"")?;
Expand Down
2 changes: 1 addition & 1 deletion src/dev/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn update() -> Result<()> {
let info_file = InfoFile::parse()?;

if cfg!(debug_assertions) {
// A hack to make `cargo run -- dev update` work when developing Rustlings.
// A hack to make `cargo dev update` work when developing Rustlings.
update_cargo_toml(&info_file.exercises, "dev/Cargo.toml", b"../")
.context("Failed to update the file `dev/Cargo.toml`")?;

Expand Down
Loading