mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-02 09:09:17 +00:00
chore: update Rust to 1.95; replace cfg_if with cfg_select (#2121)
This commit is contained in:
+12
-24
@@ -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());
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user