Cargo dependencies can be flagged as optional. These are dependencies that will be included in the final artifact if certain features defined by it are enabled. See https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies. We should at least register this property as we do with the Maven detector and its scope property.
We could also evaluate the use of the cli tool cargo tree . We need to investigate if running cargo tree --edge all returns optional dependencies that are not active, if it doesn't then we could use to remove the dependencies from the component detection report.
Cargo dependencies can be flagged as optional. These are dependencies that will be included in the final artifact if certain features defined by it are enabled. See https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies. We should at least register this property as we do with the Maven detector and its scope property.
We could also evaluate the use of the cli tool cargo tree . We need to investigate if running
cargo tree --edge allreturns optional dependencies that are not active, if it doesn't then we could use to remove the dependencies from the component detection report.