Skip to content

Commit

Permalink
fix: use correct field in ColumnDecode
Browse files Browse the repository at this point in the history
  • Loading branch information
abonander committed Jul 20, 2024
1 parent 2c8938f commit 76cf629
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions sqlx-macros-core/src/derives/row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ fn expand_derive_from_row_struct(
.and_then(|v| {
<#ty as ::std::convert::TryFrom::<#try_from>>::try_from(v)
.map_err(|e| {
// Triggers a lint warning if `TryFrom::Err = Infallible`
#[allow(unreachable_code)]
::sqlx::Error::ColumnDecode {
index: #id_s.to_string(),
error: sqlx::__spec_error!(e),
source: sqlx::__spec_error!(e),
}
})
})
Expand All @@ -142,9 +144,11 @@ fn expand_derive_from_row_struct(
.and_then(|v| {
<#ty as ::std::convert::TryFrom::<#try_from>>::try_from(v)
.map_err(|e| {
// Triggers a lint warning if `TryFrom::Err = Infallible`
#[allow(unreachable_code)]
::sqlx::Error::ColumnDecode {
index: #id_s.to_string(),
error: sqlx::__spec_error!(e),
source: sqlx::__spec_error!(e),
}
})
})
Expand All @@ -161,9 +165,11 @@ fn expand_derive_from_row_struct(
.and_then(|v| {
<#ty as ::std::convert::TryFrom::<#try_from>>::try_from(v.0)
.map_err(|e| {
// Triggers a lint warning if `TryFrom::Err = Infallible`
#[allow(unreachable_code)]
::sqlx::Error::ColumnDecode {
index: #id_s.to_string(),
error: sqlx::__spec_error!(e),
source: sqlx::__spec_error!(e),
}
})
})
Expand Down

0 comments on commit 76cf629

Please sign in to comment.