Rust: Workspace Dependencies

If you are maintaining multiple crates as part of single workspace, and you want to use **same version for dependencies across all crates in your workspace**, it is possible to specify dependency version the workspace's toml file: See also: [shareing package common data](/rust/workspace-package/).
in workspace's `Cargo.toml`
[workspace]
members = [
"crate1"
]

[workspace.dependencies]
log = "0.3.1"
log2 = { version = "2.0.0", package = "log" }
serde = { git = 'https://github.com/serde-rs/serde' }
wasm-bindgen-cli = { path = "crates/cli" }
in a workspace member's `Cargo.toml`
[dependencies]
log = { workspace = true }
Since the member is saying `workspace=true` as the version for the `log` create, the version of log crate in the member will be inherited from the workspace.