Use &str instead of String whenever possible

This commit is contained in:
2023-01-12 23:43:45 +01:00
parent 13f5c87c03
commit 06389d83f7
14 changed files with 76 additions and 62 deletions

View File

@@ -79,7 +79,9 @@ async fn app() -> Result<(), Box<dyn std::error::Error>> {
.clone()
.into_iter()
.map(|(identifier, device_config)| async {
let device = device_config.create(identifier, &config, client.clone()).await?;
// Force the async block to move identifier
let identifier = identifier;
let device = device_config.create(&identifier, &config, client.clone()).await?;
devices.add_device(device).await?;
Ok::<(), Box<dyn std::error::Error>>(())
})