Skip to content

Commit

Permalink
fix issue #22 with invalid debug_assert check
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed May 26, 2023
1 parent 3b2f10a commit a430912
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,13 @@ pub trait WriteAtomic: io::Write {
if !self.is_ready_to_write() {
Err(WriteError::NotReady)
} else {
// TODO: on EGAGAIN, EINTER, EWOULDBLOCK just keep the data buffered
self.write_or_buf(buf).map_err(|err| {
debug_assert!(
matches!(
!matches!(
err.kind(),
ErrorKind::WouldBlock | ErrorKind::Interrupted | ErrorKind::WriteZero
),
"WriteAtomic::write_or_buf must handle EGAGAIN, EINTER, EWOULDBLOCK errors by \
"WriteAtomic::write_or_buf must handle EGAGAIN, EINTR, EWOULDBLOCK errors by \
buffering the data"
);
WriteError::from(err)
Expand Down

0 comments on commit a430912

Please sign in to comment.