mirror of
https://github.com/dndx/phantun.git
synced 2025-10-15 18:25:36 +08:00
chore(cargo): bump to Rust edition 2024
(#223)
* chore(cargo): bump to Rust edition 2024 and move shared dependency into workspace `Cargo.toml` * style(phantun): use Rust 2024 `&&` combination for `if let`
This commit is contained in:
@@ -245,13 +245,12 @@ async fn main() -> io::Result<()> {
|
||||
res = sock.recv(&mut buf_tcp) => {
|
||||
match res {
|
||||
Some(size) => {
|
||||
if size > 0 {
|
||||
if let Err(e) = udp_sock.send(&buf_tcp[..size]).await {
|
||||
if size > 0
|
||||
&& let Err(e) = udp_sock.send(&buf_tcp[..size]).await {
|
||||
error!("Unable to send UDP packet to {}: {}, closing connection", e, addr);
|
||||
quit.cancel();
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
None => {
|
||||
debug!("removed fake TCP socket from connections table");
|
||||
|
Reference in New Issue
Block a user