tormol / uds

A unix domain sockets Rust library
Apache License 2.0
21 stars 9 forks source link

Add mio_08 feature #5

Closed Jake-Shadle closed 2 years ago

Jake-Shadle commented 2 years ago

This adds a mio_08 feature which is basically exactly the same as mio_07 since nothing changed that impacted this library.

I've tried to keep the diff down to a minimum but FWIW, rustfmt really wants to format basically all of the code in this repo. :cold_sweat:

tormol commented 2 years ago

Thanks. What do you think about supporting both 0.7 and 0.8 under the mio_07 feature? (with version = ">=0.7, >=0.8") I'd prefer doing it that way, unless you see a need for using this library with multiple versions of mio inside one program.

If you want to go with different features, you need to add an extern crate in lib.rs, and rename the used typess so they don't conflict.

Jake-Shadle commented 2 years ago

Yah, your solution is drastically better, I was not really thinking when doing this PR, sorry. The 1.39 MSRV check fails because of the version of the futures crate that is picked using a few features not available in 1.39, do you want me to figure out which futures version doesn't have those features and pin it, or bump the MSRV to the lowest version that has all of the features used?

tormol commented 2 years ago

Sorry, neither ">=0.7.6, >=0.8" nor ">=0.7.6, <0.9" appear to work as intended:

I created a test crate with

[dependencies]
mio = {version="0.7.6", features=["net", "os-ext", "os-poll"]}
uds = {path="..", features=["mio_07"]}

and cargo picks mio 0.8 for uds, making it not compile.

I've used such a version range in another library, and nobody has complained. :confused: I assume these version ranges only work with semver-compatible versions? And i think ">=0.7.6, >=0.8" will also match any later version like 0.9 and 1.0?

Jake-Shadle commented 2 years ago

I've also seen them work with other crates, such as https://github.com/shepmaster/twox-hash/blob/b169c16d86eb8ea4a296b0acb9d00ca7e3c3005f/Cargo.toml#L18, but even pinning the version in the root crate to =0.7.6 doesn't work.

tormol commented 2 years ago

Interesting.

You can increase MSRV to at least 1.56, or higher if you need to.

tormol commented 2 years ago

Thanks!

tormol commented 1 year ago

This is finally released! in 0.3.0.