We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c140781 commit f2bdfedCopy full SHA for f2bdfed
src/lib.rs
@@ -217,10 +217,10 @@ pub fn get_capability(our: &Address, params: &str) -> Option<Capability> {
217
.cloned()
218
}
219
220
-/// if the next message is a request, return its body, otherwise, return an error
221
-pub fn await_next_request_body() -> anyhow::Result<Vec<u8>> {
222
- let Ok(Message::Request { body, .. }) = await_message() else {
223
- return Err(anyhow::anyhow!("failed to get request body, bailing out"));
224
- };
225
- Ok(body)
+/// get the next message body from the message queue, or propagate the error
+pub fn await_next_message_body() -> anyhow::Result<Vec<u8>> {
+ match await_message() {
+ Ok(msg) => Ok(msg.body().to_vec()),
+ Err(e) => Err(e.into()),
+ }
226
0 commit comments