bnjbvr / cargo-machete

Remove unused Rust dependencies with this one weird trick!
MIT License
804 stars 29 forks source link

When no issues are found report message is incomplete. #123

Closed mjpieters closed 5 months ago

mjpieters commented 6 months ago

When cargo machete is run with no path argument (so working on the current directory), the report message is grammatically broken:

% cargo machete
Analyzing dependencies of crates in this directory...
cargo-machete didn't find any unused dependencies in .. Good job!
...

No unused dependencies were found in .. where? The same applies when there are unused dependencies:

% cargo machete
Analyzing dependencies of crates in this directory...
cargo-machete found the following unused dependencies in .:
...

The issue goes away when using a path:

% cargo machete "$PWD"
Analyzing dependencies of crates in /full/path/to/current/project...
cargo-machete didn't find any unused dependencies in /full/path/to/current/project. Good job!
...

The current directory is reported as ., but this is easily missed amongst the sentence punctuation. Perhaps the path needs to be resolved before using it in a report message, or a default like 'this directory' needs to be picked.