chore: update Rust to 1.95; replace cfg_if with cfg_select (#2121)

This commit is contained in:
Luna Yao
2026-04-17 23:41:31 +08:00
committed by GitHub
parent bcb2e512d4
commit fae32361f2
16 changed files with 66 additions and 94 deletions
+12 -24
View File
@@ -239,15 +239,11 @@ impl StunClient {
let mut mapped_addr = None;
for x in msg.attributes() {
match x {
Attribute::MappedAddress(addr) => {
if mapped_addr.is_none() {
let _ = mapped_addr.insert(addr.address());
}
Attribute::MappedAddress(addr) if mapped_addr.is_none() => {
let _ = mapped_addr.insert(addr.address());
}
Attribute::XorMappedAddress(addr) => {
if mapped_addr.is_none() {
let _ = mapped_addr.insert(addr.address());
}
Attribute::XorMappedAddress(addr) if mapped_addr.is_none() => {
let _ = mapped_addr.insert(addr.address());
}
_ => {}
}
@@ -259,15 +255,11 @@ impl StunClient {
let mut changed_addr = None;
for x in msg.attributes() {
match x {
Attribute::OtherAddress(m) => {
if changed_addr.is_none() {
let _ = changed_addr.insert(m.address());
}
Attribute::OtherAddress(m) if changed_addr.is_none() => {
let _ = changed_addr.insert(m.address());
}
Attribute::ChangedAddress(m) => {
if changed_addr.is_none() {
let _ = changed_addr.insert(m.address());
}
Attribute::ChangedAddress(m) if changed_addr.is_none() => {
let _ = changed_addr.insert(m.address());
}
_ => {}
}
@@ -714,15 +706,11 @@ impl TcpStunClient {
let mut mapped_addr = None;
for x in msg.attributes() {
match x {
Attribute::MappedAddress(addr) => {
if mapped_addr.is_none() {
let _ = mapped_addr.insert(addr.address());
}
Attribute::MappedAddress(addr) if mapped_addr.is_none() => {
let _ = mapped_addr.insert(addr.address());
}
Attribute::XorMappedAddress(addr) => {
if mapped_addr.is_none() {
let _ = mapped_addr.insert(addr.address());
}
Attribute::XorMappedAddress(addr) if mapped_addr.is_none() => {
let _ = mapped_addr.insert(addr.address());
}
_ => {}
}