diff --git a/core/src/kvs/surrealkv/mod.rs b/core/src/kvs/surrealkv/mod.rs index df812af5..5688ea31 100644 --- a/core/src/kvs/surrealkv/mod.rs +++ b/core/src/kvs/surrealkv/mod.rs @@ -130,7 +130,7 @@ impl Transaction { self.done = true; // Commit the transaction. - self.inner.commit().await.map_err(|e| Error::from(e)) + self.inner.commit().await.map_err(Into::into) } /// Checks if a key exists in the database. @@ -256,7 +256,7 @@ impl Transaction { } // Set the key. - self.inner.set(key.into().as_slice(), &val.into()).map_err(|e| Error::from(e)) + self.inner.set(key.into().as_slice(), &val.into()).map_err(Into::into) } /// Inserts a key-value pair into the database if the key doesn't already exist. @@ -285,7 +285,7 @@ impl Transaction { } // Insert the key-value pair. - self.inner.set(&key, &val.into()).map_err(|e| Error::from(e)) + self.inner.set(&key, &val.into()).map_err(Into::into) } /// Inserts a key-value pair into the database if the key doesn't already exist, @@ -335,7 +335,7 @@ impl Transaction { // Delete the key. let key_slice = key.into(); - self.inner.delete(key_slice.as_slice()).map_err(|e| Error::from(e)) + self.inner.delete(key_slice.as_slice()).map_err(Into::into) } /// Deletes a key from the database if the existing value matches the provided check value. diff --git a/core/src/syn/v1/mod.rs b/core/src/syn/v1/mod.rs index 04d0a3f2..87295104 100644 --- a/core/src/syn/v1/mod.rs +++ b/core/src/syn/v1/mod.rs @@ -107,7 +107,7 @@ fn parse_impl(input: &str, parser: impl Fn(&str) -> IResult<&str, O>) -> Resu // Continue parsing the query _ => match parser(input).finish() { // The query was parsed successfully - Ok((v, parsed)) if v.is_empty() => Ok(parsed), + Ok(("", parsed)) => Ok(parsed), // There was unparsed SQL remaining Ok((_, _)) => Err(Error::QueryRemaining), // There was an error when parsing the query