mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
Add impl FromRow for the unit type (#2827)
This commit is contained in:
parent
068ea14665
commit
ba87bf7473
@ -275,6 +275,16 @@ pub trait FromRow<'r, R: Row>: Sized {
|
||||
fn from_row(row: &'r R) -> Result<Self, Error>;
|
||||
}
|
||||
|
||||
impl<'r, R> FromRow<'r, R> for ()
|
||||
where
|
||||
R: Row,
|
||||
{
|
||||
#[inline]
|
||||
fn from_row(_: &'r R) -> Result<Self, Error> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
// implement FromRow for tuples of types that implement Decode
|
||||
// up to tuples of 9 values
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user