From db4ef3f70e612f7acc713288f6593d6cc672f5f8 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Tue, 31 Oct 2023 16:15:01 +0100 Subject: [PATCH] feat: Bump mdns-sd to 0.9.2 --- Cargo.toml | 2 +- src/advertise.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 98779ac..26bc185 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ keywords = ["wot", "WebofThings"] [dependencies] wot-td = "0.3.1" -mdns-sd = "0.7.1" +mdns-sd = "0.9.2" thiserror = "1.0" if-addrs = "0.10.1" hostname = "0.3" diff --git a/src/advertise.rs b/src/advertise.rs index 00b3582..f4190fd 100644 --- a/src/advertise.rs +++ b/src/advertise.rs @@ -5,9 +5,9 @@ //! //! This implementation mainly focuses on [DNS-SD](https://www.w3.org/TR/wot-discovery/#introduction-dns-sd). -use std::collections::HashMap; -use std::net::{IpAddr, Ipv4Addr}; +use std::net::IpAddr; use std::ops::Not; +use std::{collections::HashMap, net::Ipv4Addr}; use mdns_sd::{ServiceDaemon, ServiceInfo}; @@ -61,7 +61,7 @@ impl ThingType { pub struct Advertiser { pub(crate) mdns: ServiceDaemon, /// Default set of ips for the system - ips: Vec, + ips: Vec, /// Default hostname hostname: String, } @@ -73,7 +73,7 @@ const WELL_KNOWN: &str = "/.well-known/wot"; /// Call [`ServiceBuilder::build`] to publish it. pub struct ServiceBuilder<'a> { mdns: &'a ServiceDaemon, - ips: Vec, + ips: Vec, hostname: String, ty: ThingType, port: u16, @@ -130,7 +130,7 @@ impl<'a> ServiceBuilder<'a> { /// /// By default all the non-loopback ipv4 interfaces are used. pub fn ips>(mut self, ips: impl Iterator) -> Self { - self.ips = ips.map(|ip| ip.into()).collect(); + self.ips = ips.map(|ip| ip.into().into()).collect(); self } @@ -185,7 +185,7 @@ impl Advertiser { .filter_map(|iface| { let ip = iface.ip(); match ip { - IpAddr::V4(ip) => Some(ip), + IpAddr::V4(_) => Some(ip), _ => None, } })