mqtt_mux: remove excessive paranthesis

This commit is contained in:
occheung 2020-09-18 12:24:27 +08:00
parent a7073c419b
commit a5dbfdaf4f
1 changed files with 3 additions and 1 deletions

View File

@ -150,7 +150,7 @@ impl<SPI, E> MqttMux<SPI> where SPI: Transfer<u8, Error = E> {
let division = u8::from_str_radix(core::str::from_utf8(message).unwrap(), 10)
.map_or_else(
|_| Err(Error::MqttCommandError),
|div| if (div == 1 || div == 2 || div == 4) {
|div| if div == 1 || div == 2 || div == 4 {
Ok(div)
} else {
Err(Error::MqttCommandError)
@ -185,6 +185,8 @@ impl<SPI, E> MqttMux<SPI> where SPI: Transfer<u8, Error = E> {
}
// TODO: Implement this
// Only need to sort the command enum
// Obviously. This is what a MUX does
fn execute(&mut self, command_type: MqttCommandType) -> Result<(), Error<E>> {
info!("{:?}", command_type);
match command_type {