You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thinking more about this, why have an annoying extra step to init in the first place? The user experience would be smoother, if it would just start!
There would be 3 cases to handle:
already in directory, just go. Like: cargo run
directory exists as sub-directory, cd there internally and go. Like: cargo -C rustlings run
directory not found near here, init it transparently, cd there internally and go. Like: cargo new rustlings; cargo -C rustlings run
Original Proposal
Cargo has two near identical commands new and init. They both do exactly the same thing. (But apparently implemented twice, because the message differs a bit.) Additionally only init has a 2nd behaviour, when not given an argument.
Confusingly rustlings init is different to that! Since backwards compatibility is hardly important, I suggest to align with cargo like this:
rustlings init (re-)initialises the current directory (to avoid pain for people already used to old behaviour, maybe only if it is empty or contains Cargo.toml)
rustlings new creates the directory rustlings
rustlings init <NAME> and rustlings new <NAME> create a new directory <NAME>
The text was updated successfully, but these errors were encountered:
daniel-pfeiffer
changed the title
Rustlings command should mirror cargo command as far as possible
Init transparently (was: Rustlings command should mirror cargo command as far as possible)
Mar 16, 2025
New Proposal
Thinking more about this, why have an annoying extra step to init in the first place? The user experience would be smoother, if it would just start!
There would be 3 cases to handle:
cargo run
cargo -C rustlings run
cargo new rustlings; cargo -C rustlings run
Original Proposal
Cargo has two near identical commands
new
andinit
. They both do exactly the same thing. (But apparently implemented twice, because the message differs a bit.) Additionally onlyinit
has a 2nd behaviour, when not given an argument.Confusingly
rustlings init
is different to that! Since backwards compatibility is hardly important, I suggest to align withcargo
like this:rustlings init
(re-)initialises the current directory (to avoid pain for people already used to old behaviour, maybe only if it is empty or containsCargo.toml
)rustlings new
creates the directoryrustlings
rustlings init <NAME>
andrustlings new <NAME>
create a new directory<NAME>
The text was updated successfully, but these errors were encountered: