inre / rust-mq

RustMQ is the MQTT client written on pure Rust.
MIT License
190 stars 28 forks source link

re-export Qos type (from mqtt3) #18

Open tshepang opened 7 years ago

tshepang commented 7 years ago

One use I saw is PubOpt::new, whose first arg is Qos. At the moment, I have to add mqtt3 do Cargo.toml, which I would rather avoid (since it's an implicit dependency).

tshepang commented 7 years ago

Alternatively, maybe remove the new call since it does not seem to add anything? One can just do something like:

let opts = PubOpt::at_least_once() | PubOpt::retain();
// in place of
let opts = PubOpt::new(mqtt3::QoS::AtLeastOnce, true);

The former is more explicit, while the latter has some magical second argument.