From 1e442c189b868ce35212deb5b57c869f6b9946bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B5=D0=B9=D1=81=D1=96=20=D0=9C=D0=B0=D1=87=D0=B0?= =?UTF-8?q?=D0=B4=D0=BE?= Date: Fri, 28 Mar 2025 12:11:39 +0000 Subject: [PATCH] fix: mitigate impl ambiguity introduced in deranged 0.4.1 --- Cargo.lock | 12 ++++++------ veilid-core/src/attachment_manager.rs | 22 ++++++++++++++++------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 63e86612..edd90e45 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1570,9 +1570,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058" dependencies = [ "powerfmt", ] @@ -5651,9 +5651,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.40" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9c75b47bdff86fa3334a3db91356b8d7d86a9b839dab7d0bdc5c3d3a077618" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", @@ -5674,9 +5674,9 @@ checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29aa485584182073ed57fd5004aa09c371f021325014694e432313345865fd04" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ "num-conv", "time-core", diff --git a/veilid-core/src/attachment_manager.rs b/veilid-core/src/attachment_manager.rs index 73e79209..b74cceda 100644 --- a/veilid-core/src/attachment_manager.rs +++ b/veilid-core/src/attachment_manager.rs @@ -81,20 +81,30 @@ impl AttachmentManager { health: &RoutingTableHealth, config: &VeilidConfigRoutingTable, ) -> AttachmentState { - if health.reliable_entry_count >= config.limit_over_attached.try_into().unwrap() { + if health.reliable_entry_count + >= TryInto::::try_into(config.limit_over_attached).unwrap() + { return AttachmentState::OverAttached; } - if health.reliable_entry_count >= config.limit_fully_attached.try_into().unwrap() { + if health.reliable_entry_count + >= TryInto::::try_into(config.limit_fully_attached).unwrap() + { return AttachmentState::FullyAttached; } - if health.reliable_entry_count >= config.limit_attached_strong.try_into().unwrap() { + if health.reliable_entry_count + >= TryInto::::try_into(config.limit_attached_strong).unwrap() + { return AttachmentState::AttachedStrong; } - if health.reliable_entry_count >= config.limit_attached_good.try_into().unwrap() { + if health.reliable_entry_count + >= TryInto::::try_into(config.limit_attached_good).unwrap() + { return AttachmentState::AttachedGood; } - if health.reliable_entry_count >= config.limit_attached_weak.try_into().unwrap() - || health.unreliable_entry_count >= config.limit_attached_weak.try_into().unwrap() + if health.reliable_entry_count + >= TryInto::::try_into(config.limit_attached_weak).unwrap() + || health.unreliable_entry_count + >= TryInto::::try_into(config.limit_attached_weak).unwrap() { return AttachmentState::AttachedWeak; }