Fix clippy warnings (#3529)

This commit is contained in:
Rushmore Mushambi 2024-02-16 19:09:55 +02:00 committed by GitHub
parent bbd5268e71
commit 41a7c16338
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -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.

View file

@ -107,7 +107,7 @@ fn parse_impl<O>(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