daemon: use matches! for the link-local host-replace check
Silences clippy::match_like_matches_macro; same logic, no behavior change.
This commit is contained in:
parent
7fb1934d52
commit
b792743626
1 changed files with 4 additions and 4 deletions
|
|
@ -141,10 +141,10 @@ impl Daemon {
|
||||||
// `TcpStream::connect`ing to it fails outright; don't let
|
// `TcpStream::connect`ing to it fails outright; don't let
|
||||||
// one clobber an already-usable host just because it
|
// one clobber an already-usable host just because it
|
||||||
// happened to resolve more recently.
|
// happened to resolve more recently.
|
||||||
let should_replace = match self.cast_devices.get(&device.id) {
|
let should_replace = !matches!(
|
||||||
Some(existing) if is_link_local_v6(&device.host) && !is_link_local_v6(&existing.host) => false,
|
self.cast_devices.get(&device.id),
|
||||||
_ => true,
|
Some(existing) if is_link_local_v6(&device.host) && !is_link_local_v6(&existing.host)
|
||||||
};
|
);
|
||||||
if should_replace {
|
if should_replace {
|
||||||
self.cast_devices.insert(device.id.clone(), device);
|
self.cast_devices.insert(device.id.clone(), device);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue