Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
ibigbug committed Sep 23, 2024
1 parent 43f6108 commit 02c0f09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions clash_lib/src/proxy/shadowsocks/datagram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ impl DatagramSend for ShadowsocksUdpIo {
match w.poll_flush_unpin(cx) {
Poll::Ready(Ok(())) => Poll::Ready(Ok(buf.len())),
Poll::Ready(Err(e)) => {
return Poll::Ready(Err(new_io_error(e.to_string())))
Poll::Ready(Err(new_io_error(e.to_string())))
}
Poll::Pending => return Poll::Pending,
Poll::Pending => Poll::Pending,
}
}

Expand Down Expand Up @@ -275,8 +275,8 @@ impl DatagramReceive for ShadowsocksUdpIo {
}
Poll::Ready(Ok(()))
}
Poll::Pending => return Poll::Pending,
Poll::Ready(None) => return Poll::Ready(Ok(())),
Poll::Pending => Poll::Pending,
Poll::Ready(None) => Poll::Ready(Ok(())),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions clash_lib/src/proxy/tun/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ mod tests {
let log_path = cwd + "/" + &log_file + "." + &today.to_string();

let logs = std::fs::read_to_string(&log_path)
.expect(format!("failed to read log file: {}", log_path).as_str());
.unwrap_or_else(|_| panic!("failed to read log file: {}", log_path));

assert!(logs.contains("1.1.1.1:53 to MATCH"));

Expand Down Expand Up @@ -161,7 +161,7 @@ mod tests {
let log_path = cwd + "/" + &log_file + "." + &today.to_string();

let logs = std::fs::read_to_string(&log_path)
.expect(format!("failed to read log file: {}", log_path).as_str());
.unwrap_or_else(|_| panic!("failed to read log file: {}", log_path));

assert!(logs.contains("route_all is enabled"));
assert!(logs.contains(format!("{} to MATCH", echo_addr).as_str()));
Expand Down

0 comments on commit 02c0f09

Please sign in to comment.