mirror of
https://github.com/isar/rusqlite.git
synced 2025-10-26 03:08:57 +08:00
Rustfmt
This commit is contained in:
17
src/error.rs
17
src/error.rs
@@ -85,13 +85,18 @@ impl fmt::Display for Error {
|
||||
match self {
|
||||
&Error::SqliteFailure(ref err, None) => err.fmt(f),
|
||||
&Error::SqliteFailure(_, Some(ref s)) => write!(f, "{}", s),
|
||||
&Error::SqliteSingleThreadedMode => write!(f, "SQLite was compiled or configured for single-threaded use only"),
|
||||
&Error::SqliteSingleThreadedMode => {
|
||||
write!(f,
|
||||
"SQLite was compiled or configured for single-threaded use only")
|
||||
}
|
||||
&Error::FromSqlConversionFailure(ref err) => err.fmt(f),
|
||||
&Error::Utf8Error(ref err) => err.fmt(f),
|
||||
&Error::NulError(ref err) => err.fmt(f),
|
||||
&Error::InvalidParameterName(ref name) => write!(f, "Invalid parameter name: {}", name),
|
||||
&Error::InvalidPath(ref p) => write!(f, "Invalid path: {}", p.to_string_lossy()),
|
||||
&Error::ExecuteReturnedResults => write!(f, "Execute returned results - did you mean to call query?"),
|
||||
&Error::ExecuteReturnedResults => {
|
||||
write!(f, "Execute returned results - did you mean to call query?")
|
||||
}
|
||||
&Error::QueryReturnedNoRows => write!(f, "Query returned no rows"),
|
||||
&Error::GetFromStaleRow => write!(f, "Attempted to get a value from a stale row"),
|
||||
&Error::InvalidColumnIndex(i) => write!(f, "Invalid column index: {}", i),
|
||||
@@ -111,13 +116,17 @@ impl error::Error for Error {
|
||||
match self {
|
||||
&Error::SqliteFailure(ref err, None) => err.description(),
|
||||
&Error::SqliteFailure(_, Some(ref s)) => s,
|
||||
&Error::SqliteSingleThreadedMode => "SQLite was compiled or configured for single-threaded use only",
|
||||
&Error::SqliteSingleThreadedMode => {
|
||||
"SQLite was compiled or configured for single-threaded use only"
|
||||
}
|
||||
&Error::FromSqlConversionFailure(ref err) => err.description(),
|
||||
&Error::Utf8Error(ref err) => err.description(),
|
||||
&Error::InvalidParameterName(_) => "invalid parameter name",
|
||||
&Error::NulError(ref err) => err.description(),
|
||||
&Error::InvalidPath(_) => "invalid path",
|
||||
&Error::ExecuteReturnedResults => "execute returned results - did you mean to call query?",
|
||||
&Error::ExecuteReturnedResults => {
|
||||
"execute returned results - did you mean to call query?"
|
||||
}
|
||||
&Error::QueryReturnedNoRows => "query returned no rows",
|
||||
&Error::GetFromStaleRow => "attempted to get a value from a stale row",
|
||||
&Error::InvalidColumnIndex(_) => "invalid column index",
|
||||
|
||||
Reference in New Issue
Block a user