mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Clippy things
This commit is contained in:
parent
0f6323e2de
commit
7c665c9a77
2 changed files with 7 additions and 2 deletions
|
@ -8,6 +8,8 @@ use std::path::Path;
|
||||||
enum SqliteError {
|
enum SqliteError {
|
||||||
#[error("SQLite transaction already committted")]
|
#[error("SQLite transaction already committted")]
|
||||||
TransactionAlreadyCommitted,
|
TransactionAlreadyCommitted,
|
||||||
|
#[error("Failed to create SQLite transaction")]
|
||||||
|
CreateTransactionFailed,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Newtype to allow implementing `FromSql` for foreign `uuid::Uuid`
|
/// Newtype to allow implementing `FromSql` for foreign `uuid::Uuid`
|
||||||
|
@ -96,7 +98,10 @@ struct Txn<'t> {
|
||||||
|
|
||||||
impl<'t> Txn<'t> {
|
impl<'t> Txn<'t> {
|
||||||
fn get_txn(&mut self) -> Result<rusqlite::Transaction, SqliteError> {
|
fn get_txn(&mut self) -> Result<rusqlite::Transaction, SqliteError> {
|
||||||
Ok(self.con.transaction().unwrap())
|
Ok(self
|
||||||
|
.con
|
||||||
|
.transaction()
|
||||||
|
.map_err(|_e| SqliteError::CreateTransactionFailed)?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ pub struct LocalServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LocalServer {
|
impl LocalServer {
|
||||||
fn txn<'a>(&'a mut self) -> anyhow::Result<rusqlite::Transaction> {
|
fn txn(&mut self) -> anyhow::Result<rusqlite::Transaction> {
|
||||||
let txn = self.con.transaction()?;
|
let txn = self.con.transaction()?;
|
||||||
Ok(txn)
|
Ok(txn)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue