greyblake / whatlang-rs

Natural language detection library for Rust. Try demo online: https://whatlang.org/
https://whatlang.org/
MIT License
966 stars 108 forks source link

Failed to compile #50

Closed AlexMikhalev closed 4 years ago

AlexMikhalev commented 4 years ago
    |
259 |     Lat = 84,
    |     --- not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
    = note: the matched value is of type `whatlang::Lang`

using dockerfile from https://github.com/valeriansaliou/sonic/blob/master/Dockerfile (same locally on Mac Book Pro with homebrew

greyblake commented 4 years ago

Tests are passing. Running an example in the repo works as well:

cargo run --example cli

Which version of whatlang and rustc are you using?

@AlexMikhalev Could you please provide concrete steps to reproduce?

AlexMikhalev commented 4 years ago

hello, @greyblake, cargo install sonic (and docker build from sonic repo) fails and complains about the absence of Lat matching in whatlang-rs, seems the previous version had this issue and cached or picked up automatically. Checkout and build separately work. I think this issue can be closed. A

greyblake commented 4 years ago

@AlexMikhalev Ah.. I think it makes sense. Whatlang recently added Latin language, and version was bumped from 0.7.3 -> 0.7.4.

But adding a new language is rather a breaking change, so minor version must be updated (not patch). This probably breaks sonic, because it depends on 0.7 and not on 0.7.3: https://github.com/valeriansaliou/sonic/blob/master/Cargo.toml#L42

greyblake commented 4 years ago

I've communicated the issue to Sonic developers: https://github.com/valeriansaliou/sonic/issues/206

Dr-Emann commented 4 years ago

If you consider this a breaking change, should you yank the 0.7.4 release, and re-release as 0.8.0?

Or you could make the Lang (and Script?) non-exhaustive (either with #[non_exhaustive] introduced in 1.40, or a #[doc(hidden)] final language?) in order to express that adding items to the enums should be a non-breaking change?

greyblake commented 4 years ago

Thanks for the suggestion. I've done so: 0.7.4 is yanked, 0.8.0 is released instead