Skip to content

Commit

Permalink
Add impl FromRow for the unit type (#2827)
Browse files Browse the repository at this point in the history
  • Loading branch information
nanoqsh authored Oct 23, 2023
1 parent 068ea14 commit ba87bf7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sqlx-core/src/from_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ba87bf7

Please sign in to comment.