mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-04-16 22:13:14 -04:00
Merge branch 'fix/mitigate-deranged-impl-ambiguity' into 'main'
fix: mitigate impl ambiguity introduced in deranged 0.4.1 See merge request veilid/veilid!386
This commit is contained in:
commit
8352b588a1
12
Cargo.lock
generated
12
Cargo.lock
generated
@ -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",
|
||||
|
@ -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::<usize>::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::<usize>::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::<usize>::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::<usize>::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::<usize>::try_into(config.limit_attached_weak).unwrap()
|
||||
|| health.unreliable_entry_count
|
||||
>= TryInto::<usize>::try_into(config.limit_attached_weak).unwrap()
|
||||
{
|
||||
return AttachmentState::AttachedWeak;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user