Repository: fMeow/arangors (language: rust)

Issue:
Unit test failing on AqlQueryBuilder
Hey @fMeow , how are you doing ? :smile: 

I am still playing with Rust :laughing: 

But I got an issue today and I am not sure why. I did updated arangor to 0.5.0 since I am using the latest `actix-web` now.

Here is the error when I want to use `arangors 0.5.0`  or unit test it : 

![image](https://user-images.githubusercontent.com/30114057/132215713-0af12b2e-3bc4-4c6e-890c-cb9a13fa98d9.png)


Did somebody sae that 0.5.0 tests were failing ?







Discussion / hints:
I am not using `arangors` directly so this might not be much of a help, but, it's most likely because `typed-builder` dependency got upgraded, see: https://github.com/adeira/universe/commit/525023296e2422e72c86d86304a2844a7f5d97ec

Maybe you can pin the dependency?

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index 07dd42f..edef266 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -41,7 +41,7 @@ maybe-async = "0.2"
 serde_json = "1"
 serde_qs = "0.8"
 thiserror = "1"
-typed-builder = "0.9"
+typed-builder = "0.9.1"
 url = "2"
 uclient = "0.1"
 
diff --git a/src/aql.rs b/src/aql.rs
index 520a4e8..40b9434 100644
--- a/src/aql.rs
+++ b/src/aql.rs
@@ -150,7 +150,7 @@ impl<'a, __query, __count, __batch_size, __cache, __memory_limit, __ttl, __optio
                 ttl,
                 options,
             ),
-            _phantom: self._phantom,
+            phantom: self.phantom,
         }
     }
 
diff --git a/src/collection/mod.rs b/src/collection/mod.rs
index 59e62be..3b61587 100644
--- a/src/collection/mod.rs
+++ b/src/collection/mod.rs
@@ -134,7 +134,7 @@ impl<'a, C: ClientExt> Collection<C> {
     /// characters only. Please refer to Naming Conventions in ArangoDB for more
     /// information on valid collection names.
     pub fn name(&self) -> &str {
-        &self.name.as_str()
+        self.name.as_str()
     }
 
     /// Collection url: http://server:port/_db/mydb/_api/collection/{collection-name}
diff --git a/src/connection/mod.rs b/src/connection/mod.rs
index 02b6168..e5adcb6 100644
--- a/src/connection/mod.rs
+++ b/src/connection/mod.rs
@@ -349,7 +349,7 @@ impl<C: ClientExt> GenericConnection<C, Normal> {
         password: T,
     ) -> Result<String, ClientError> {
         #[derive(Deserialize)]
-        struct JWT {
+        struct Jwt {
             pub jwt: String,
         }
         let url = arango_url.join("/_open/auth").unwrap();
@@ -358,7 +358,7 @@ impl<C: ClientExt> GenericConnection<C, Normal> {
         map.insert("username", username.into());
         map.insert("password", password.into());
 
-        let jwt: JWT = deserialize_response(
+        let jwt: Jwt = deserialize_response(
             C::new(None)?
                 .post(url, &serde_json::to_string(&map)?)
                 .await?
diff --git a/src/response.rs b/src/response.rs
index b17017f..996dd24 100644
--- a/src/response.rs
+++ b/src/response.rs
@@ -49,9 +49,9 @@ pub(crate) enum Response<T> {
     Err(ArangoError),
 }
 
-impl<T> Into<Result<T, ArangoError>> for Response<T> {
-    fn into(self) -> Result<T, ArangoError> {
-        match self {
+impl<T> From<Response<T>> for Result<T, ArangoError> {
+    fn from(resp: Response<T>) -> Self {
+        match resp {
             Response::Ok(success) => Ok(success),
             Response::Err(err) => Err(err),
         }


Test patch:
diff --git a/tests/connection.rs b/tests/connection.rs
index 54ad28c..57b82a2 100644
--- a/tests/connection.rs
+++ b/tests/connection.rs
@@ -45,7 +45,7 @@ async fn test_get_url() {
     let conn = Connection::establish_jwt(&host, &user, &password)
         .await
         .unwrap();
-    let url = conn.url().clone().into_string();
+    let url: String = conn.url().clone().into();
     assert_eq!(url, host)
 }