Workspace-centric `cargo add/remove`?
⚓ Rust 📅 2025-06-20 👤 surdeus 👁️ 15Gradually warming up to the concept of a workspace.
cargo new --lib inner_crate has got to be my new favourite thing to type.
Alas, there doesn't appear to be a simple way to add/remove an inner workspace member from the list of dependencies. Unless I'm missing something obvious? To clarify: is there a
cargo new --lib inner [--workspace/--dep]?- to- (a) create an
innerfolder - (b) add it in
workspace.membersofCargo.toml - (c) add it as
inner = { path = "./inner" }intoworkspace.dependencies
- (a) create an
cargo remove inner [--workspace/--dep]?- to- (a) delete the same folder from the drive
- (b) remove it from
workspace.membersand.dependencies
Or anything like it built-in and shipped with cargo?
Side question: it doesn't seem possible to have the name of the inner in the dependencies of the workspace itself be different from the path and/or (?) its own package.name - any idea why?
1 post - 1 participant
🏷️ rust_feed