src: mqtt: Use simpler struct instanciation syntax
This commit is contained in:
+5
-6
@@ -54,13 +54,12 @@ impl MQTT {
|
|||||||
mqttoptions.set_keep_alive(Duration::from_secs(5));
|
mqttoptions.set_keep_alive(Duration::from_secs(5));
|
||||||
|
|
||||||
let (client, eventloop) = AsyncClient::new(mqttoptions, 1);
|
let (client, eventloop) = AsyncClient::new(mqttoptions, 1);
|
||||||
let mqtt = MQTT {
|
|
||||||
config: config,
|
|
||||||
client: client,
|
|
||||||
eventloop: eventloop,
|
|
||||||
};
|
|
||||||
|
|
||||||
mqtt
|
MQTT {
|
||||||
|
config,
|
||||||
|
client,
|
||||||
|
eventloop,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn subscribe<F: Fn(StatusMessage)>(&mut self, callback: F) -> Result<()> {
|
pub async fn subscribe<F: Fn(StatusMessage)>(&mut self, callback: F) -> Result<()> {
|
||||||
|
|||||||
Reference in New Issue
Block a user