eclipse / paho.mqtt.rust

paho.mqtt.rust
Other
518 stars 102 forks source link

Some clippy fixes #122

Closed qm3ster closed 3 years ago

qm3ster commented 3 years ago

A bit more are on the way. Edit: ye, am done now. The rest require bikeshedding, maybe even conscious thought.

Stuff like

match tok.try_wait() {
    //Some(Err(Error::Paho(ERR_CODE))) => (),
    Some(Err(Error::PahoDescr(ERR_CODE, _))) => (),
    Some(Err(_)) => assert!(false),
    Some(Ok(_)) => assert!(false),
    None => assert!(false)
}

I changed to

match tok.try_wait() {
    //  Some(Err(Error::Paho(ERR_CODE))) => {}
    Some(Err(Error::PahoDescr(ERR_CODE, _))) => {}
    Some(Err(_)) | Some(Ok(_)) | None => unreachable!()
}

because

assert_matches!(tok.try_wait().unwrap_err(), Error::PahoDescr(ERR_CODE, _));

or

assert_matches!(tok.try_wait(), Err(Error::PahoDescr(ERR_CODE, _)));

is not stable yet

qm3ster commented 3 years ago

I am likely done for this week... or this life? Peace out!

And remember - never squash marge, think of the children.

fpagliughi commented 3 years ago

Merged into the develop branch. Thanks, again, @qm3ster !