Skip to content

Commit

Permalink
Fixup TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervonb committed Aug 9, 2023
1 parent 2be8253 commit 4518292
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions async-nats/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,9 @@ impl ConnectionHandler {
length,
};

// TODO don't unwrap
sender.send(message).unwrap();
sender.send(message).map_err(|err| {
io::Error::new(io::ErrorKind::Other, "request receiver closed")
})?;
}
}
}
Expand Down Expand Up @@ -634,8 +635,9 @@ impl ConnectionHandler {
headers,
sender,
} => {
// FIXME unwrap or err
let (prefix, token) = respond.rsplit_once('.').unwrap();
let (prefix, token) = respond.rsplit_once('.').ok_or_else(|| {
io::Error::new(io::ErrorKind::Other, "malformed request subject")
})?;

let multiplexer = if let Some(multiplexer) = self.multiplexer.as_mut() {
multiplexer
Expand Down

0 comments on commit 4518292

Please sign in to comment.