Skip to content

Commit

Permalink
Fix Windows-only clippy warnings.
Browse files Browse the repository at this point in the history
This works around al8n/fs4-rs#31 .
  • Loading branch information
mstange committed Jan 19, 2025
1 parent c747efc commit e51cfa0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions samply/src/windows/utility_process/file_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl<T: DeserializeOwned> Receiver<T> {
match self.current_lock.try_lock_exclusive() {
Ok(()) => {
// Not locked yet.
self.current_lock.unlock().unwrap();
FileExt::unlock(&self.current_lock).unwrap();
}
Err(e) if e.kind() == std::io::ErrorKind::Interrupted => {}
Err(e) if e.raw_os_error() == lock_contended_error().raw_os_error() => {
Expand All @@ -131,7 +131,7 @@ impl<T: DeserializeOwned> Receiver<T> {
pub fn recv_blocking(&mut self) -> Result<T, Box<dyn Error + Send + Sync>> {
self.current_lock.lock_exclusive()?; // block until init message is written
let msg = self.reader.recv()?;
self.current_lock.unlock()?;
FileExt::unlock(&self.current_lock)?;
std::mem::swap(&mut self.current_lock, &mut self.next_lock);
Ok(msg)
}
Expand Down Expand Up @@ -166,7 +166,7 @@ impl<T: Serialize> Sender<T> {
self.writer.send(msg)?;
self.next_lock.lock_exclusive()?; // ready next lock
std::mem::swap(&mut self.current_lock, &mut self.next_lock);
self.next_lock.unlock()?; // indicate that reply has been written
FileExt::unlock(&self.next_lock)?; // indicate that reply has been written
Ok(())
}
}
Expand Down

0 comments on commit e51cfa0

Please sign in to comment.