Enhancement: manage dependency version via workspace.dependencies
Considers managing dependencies version in root Cargo.toml.
i.g.,
# [PROJECT_DIR]/Cargo.toml
[workspace]
members = ["bar"]
[workspace.package]
version = "1.2.3"
authors = ["Nice Folks"]
description = "A short description of my package"
documentation = "https://example.com/bar"
# [PROJECT_DIR]/bar/Cargo.toml
[package]
name = "bar"
version.workspace = true
authors.workspace = true
description.workspace = true
documentation.workspace = true
We can utilize this to avoid dependency version conflicts in the sub-crates.
See also, https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table
After using this, do all crates need to have the same version?
After using this, do all crates need to have the same version?
No, it's configurable. If some crates try to use another version, keep setting a specific version instead of pkg.workspace = true.
I haven't see the benefit of it, could you give a more detail example?
Done in #157.