orlp
orlp

Reputation: 117771

How to find dead code in a cargo workspace?

Rust will helpfully warn you if you have non-public functions or other items that are never used in the crate. This is great when developing a single crate, but has issues when you split your program up in multiple crates in a workspace.

Is there a way to automatically find dead code across multiple crates in a workspace? Ideally I'd be able to mark one crate in the workspace as a 'main' crate, and then every item which does not end up (indirectly) being used in the main crate (even if it is pub) is warned about as being unused.

Upvotes: 2

Views: 49

Answers (0)

Related Questions