Skip to content

Commit e73fff3

Browse files
committed
Add dev alias
1 parent 8dff0df commit e73fff3

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[alias]
2+
dev = ["run", "--", "dev"]

dev/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Don't edit the `bin` list manually! It is updated by `cargo run -- dev update`. This comment line will be stripped in `rustlings init`.
1+
# Don't edit the `bin` list manually! It is updated by `cargo dev update`. This comment line will be stripped in `rustlings init`.
22
bin = [
33
{ name = "intro1", path = "../exercises/00_intro/intro1.rs" },
44
{ name = "intro1_sol", path = "../solutions/00_intro/intro1.rs" },

src/dev/check.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn check_cargo_toml(
4343
if old_bins != new_bins {
4444
if cfg!(debug_assertions) {
4545
bail!(
46-
"The file `dev/Cargo.toml` is outdated. Run `cargo run -- dev update` to update it. Then run `cargo run -- dev check` again"
46+
"The file `dev/Cargo.toml` is outdated. Run `cargo dev update` to update it. Then run `cargo run -- dev check` again"
4747
);
4848
}
4949

@@ -379,7 +379,7 @@ pub fn check(require_solutions: bool) -> Result<()> {
379379
}
380380

381381
if cfg!(debug_assertions) {
382-
// A hack to make `cargo run -- dev check` work when developing Rustlings.
382+
// A hack to make `cargo dev check` work when developing Rustlings.
383383
check_cargo_toml(&info_file.exercises, "dev/Cargo.toml", b"../")?;
384384
} else {
385385
check_cargo_toml(&info_file.exercises, "Cargo.toml", b"")?;

src/dev/update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn update() -> Result<()> {
2828
let info_file = InfoFile::parse()?;
2929

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

0 commit comments

Comments
 (0)