FromSqlError::cause() returns other error's cause directly (possibly None).

This commit is contained in:
John Gallagher 2016-12-31 00:36:52 -05:00
parent 4181441d63
commit 2e140d0684

View File

@ -33,7 +33,7 @@ impl Error for FromSqlError {
fn cause(&self) -> Option<&Error> {
match *self {
FromSqlError::InvalidType => None,
FromSqlError::Other(ref err) => Some(&**err),
FromSqlError::Other(ref err) => err.cause(),
}
}
}