cargo-geiger icon indicating copy to clipboard operation
cargo-geiger copied to clipboard

Allow checking only library, not bin

Open jyn514 opened this issue 5 years ago • 3 comments

I want to run cargo geiger on the tree_magic library. However, geiger tries to run on the binary as well, leading to a compile error:

error[E0463]: can't find crate for `clap`
  --> src/main.rs:25:1
   |
25 | extern crate clap;
   | ^^^^^^^^^^^^^^^^^^ can't find crate

I think it may not be respecting the required-features = ["cli"] line in Cargo.toml, but any case I would expect --lib not to count the lines of unsafe in src/main.rs.

jyn514 avatar Feb 03 '20 22:02 jyn514

Thanks for the report!

anderejd avatar Feb 04 '20 08:02 anderejd

Hey I'm new to these repos, but I had trouble reproducing this bug.

HEAD (fcbb9592de0104e7fe6b9a580839f360a2fddbc8) of tree_magic master is not building, so I checked out e267314, and ran cargo geiger --features=cli, but i did not see the can't find crate error you got above.

mmou avatar Apr 09 '20 20:04 mmou

Run without --features=cli and you should get the error: cargo geiger --lib

jyn514 avatar Apr 09 '20 21:04 jyn514