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.
rest_query_state
1 parent 8ff8971 commit 6047608Copy full SHA for 6047608
common/src/queries/utils.rs
@@ -21,7 +21,6 @@ where
21
extractor(message)
22
}
23
24
-/// The outer option in the extractor return value is whether the response was handled by F
25
pub async fn rest_query_state<T, F>(
26
context: &Arc<Context<Message>>,
27
topic: &str,
@@ -33,9 +32,11 @@ where
33
32
T: Serialize,
34
{
35
let data = query_state(context, topic, request_msg, |response| {
36
- extractor(response).ok_or_else(Err(QueryError::internal_error(format!(
37
- "Unexpected response message type while calling {topic}"
38
- ))))
+ extractor(response).ok_or_else(|| {
+ QueryError::internal_error(format!(
+ "Unexpected response message type while calling {topic}"
+ ))
39
+ })?
40
})
41
.await?;
42
0 commit comments