Skip to content

Commit

Permalink
fix(postgres): fix missing inversion on PgNumeric::is_valid_digit()
Browse files Browse the repository at this point in the history
  • Loading branch information
abonander committed Aug 24, 2024
1 parent 394a7e8 commit b5c218e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sqlx-postgres/src/types/numeric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ impl PgNumeric {
buf.extend(&scale.to_be_bytes());

for (i, &digit) in digits.iter().enumerate() {
if Self::is_valid_digit(digit) {
return Err(format!("{i}th PgNumeric digit out of range {digit}"));
if !Self::is_valid_digit(digit) {
return Err(format!("{i}th PgNumeric digit out of range: {digit}"));
}

buf.extend(&digit.to_be_bytes());
Expand Down

0 comments on commit b5c218e

Please sign in to comment.