Skip to content

Instantly share code, notes, and snippets.

@pimeys
Created June 10, 2019 14:31
Show Gist options
  • Save pimeys/1f25787fd91c4284a7cbb88569e259a3 to your computer and use it in GitHub Desktop.
Save pimeys/1f25787fd91c4284a7cbb88569e259a3 to your computer and use it in GitHub Desktop.
index 082d750..4e45291 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -91,11 +91,7 @@ pub struct Client {
impl Client {
/// Send a query to Fauna servers and parsing the response.
- pub fn query<'a, Q>(&self, query: Q) -> FutureResponse<Response>
- where
- Q: Into<Expr<'a>>,
- {
- let query = query.into();
+ pub fn query<'a>(&self, query: Expr<'a>) -> FutureResponse<Response> {
let payload_json = serde_json::to_string(&query).unwrap();
trace!("Querying with: {:?}", &payload_json);
diff --git a/src/client/sync.rs b/src/client/sync.rs
index 16b4e45..bc83c21 100644
--- a/src/client/sync.rs
+++ b/src/client/sync.rs
@@ -16,10 +16,7 @@ impl SyncClient {
})
}
- pub fn query<'a, Q>(&mut self, query: Q) -> FaunaResult<Response>
- where
- Q: Into<Expr<'a>>,
- {
+ pub fn query<'a>(&mut self, query: Expr<'a>) -> FaunaResult<Response> {
self.runtime.block_on(self.inner.query(query))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment