jordanbray / chess

A rust library to manage chess move generation
https://jordanbray.github.io/chess/
MIT License
234 stars 54 forks source link

Remove #[allow(dead_code)] #8

Closed niklasf closed 7 years ago

niklasf commented 7 years ago

The dead code warnings are coming from the build script. On the other hand public methods in libraries can never be dead code. Let's just ignore dead code warnings in build.rs instead of all over the place.

jordanbray commented 7 years ago

Yea, I wrote in the #[allow(dead_code)] specifically for the build.rs script. I agree that the public interface cannot have dead code. The problem is that the build.rs file has a lot of warnings, and it makes it hard to work on. I may merge this anyways. I'll play around with it tonight when I get home. Maybe there's some better solution that can keep the warnings away in build.rs, keep build.rs using the same libraries as the rest of the code, and get rid of the warnings.

niklasf commented 7 years ago

I should have worded this more clearly, since it's a bit hidden in the patch: The proposal is to add a module level #![allow(dead_code)] just to build.rs.

Probably the only other way would be making a library that can be used as a build dependency in build.rs to bootstrap the main library.

jordanbray commented 7 years ago

Looks good. I confirmed there are no warnings created in build.rs. I see how you did that now. Actually, I was looking for a way to do that originally, and I didn't figure it out for some reason.