fix(postgres): fix missing inversion on PgNumeric::is_valid_digit()

This commit is contained in:
Austin Bonander 2024-08-22 17:48:53 -07:00
parent 394a7e86a7
commit b5c218eb23

View file

@ -151,8 +151,8 @@ impl PgNumeric {
buf.extend(&scale.to_be_bytes()); buf.extend(&scale.to_be_bytes());
for (i, &digit) in digits.iter().enumerate() { for (i, &digit) in digits.iter().enumerate() {
if Self::is_valid_digit(digit) { if !Self::is_valid_digit(digit) {
return Err(format!("{i}th PgNumeric digit out of range {digit}")); return Err(format!("{i}th PgNumeric digit out of range: {digit}"));
} }
buf.extend(&digit.to_be_bytes()); buf.extend(&digit.to_be_bytes());