mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 00:39:20 +08:00
Implement source
and not cause
for FromSqlError
This commit is contained in:
parent
611c8e8b02
commit
5a8108bd86
@ -26,7 +26,7 @@ pub enum FromSqlError {
|
|||||||
InvalidUuidSize(usize),
|
InvalidUuidSize(usize),
|
||||||
|
|
||||||
/// An error case available for implementors of the `FromSql` trait.
|
/// An error case available for implementors of the `FromSql` trait.
|
||||||
Other(Box<dyn Error + Send + Sync>),
|
Other(Box<dyn Error + Send + Sync + 'static>),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PartialEq for FromSqlError {
|
impl PartialEq for FromSqlError {
|
||||||
@ -75,12 +75,11 @@ impl Error for FromSqlError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::match_same_arms)]
|
fn source(&self) -> Option<&(dyn Error + 'static)> {
|
||||||
#[allow(deprecated)]
|
if let FromSqlError::Other(ref err) = self {
|
||||||
fn cause(&self) -> Option<&dyn Error> {
|
Some(&**err)
|
||||||
match *self {
|
} else {
|
||||||
FromSqlError::Other(ref err) => err.cause(),
|
None
|
||||||
_ => None,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user