Skip to content

Commit

Permalink
fix clippy warning on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-jq-b committed May 16, 2024
1 parent b204a29 commit 3ea0202
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions lib/g3-compat/src/sched/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,9 @@

use std::io;

#[derive(Clone)]
#[derive(Clone, Default)]
pub struct CpuAffinity {}

impl Default for CpuAffinity {
fn default() -> Self {
CpuAffinity {}
}
}

impl CpuAffinity {
pub fn add_id(&mut self, _id: usize) -> io::Result<()> {
Err(io::Error::new(
Expand Down
4 changes: 2 additions & 2 deletions lib/g3-socket/src/raw/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ use super::RawSocket;
impl RawSocket {
pub fn sendmsg(&self, iov: &[IoSlice<'_>], target: Option<SocketAddr>) -> io::Result<usize> {
let msg_hdr = MsgHdr::new().with_buffers(iov);
let target = target.map(|v| SockAddr::from(v));
let target = target.map(SockAddr::from);
let msg_hdr = if let Some(addr) = &target {
msg_hdr.with_addr(&addr)
msg_hdr.with_addr(addr)
} else {
msg_hdr
};
Expand Down

0 comments on commit 3ea0202

Please sign in to comment.