Skip to content

Commit

Permalink
fix try_acquire for wasm target (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
jozanza authored Apr 18, 2024
1 parent 4ac8212 commit 7b96b41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ impl Client {
pub fn try_acquire(&self) -> io::Result<Option<Acquired>> {
let mut lock = self.inner.count.lock().unwrap_or_else(|e| e.into_inner());
if *lock == 0 {
None
Ok(None)
} else {
*lock -= 1;
Ok(Acquired(()))
Ok(Some(Acquired(())))
}
}

Expand Down

0 comments on commit 7b96b41

Please sign in to comment.