Skip to content

Commit 9d6bf66

Browse files
authored
sqlx-postgres: fix correct operator precedence in byte length check (#4165)
1 parent 0e7defa commit 9d6bf66

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sqlx-postgres/src/types/geometry/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl PgPath {
131131
.into());
132132
}
133133

134-
if bytes.len() % BYTE_WIDTH * 2 != 0 {
134+
if bytes.len() % (BYTE_WIDTH * 2) != 0 {
135135
return Err(format!(
136136
"data length not divisible by pairs of {BYTE_WIDTH}: {}",
137137
bytes.len()

sqlx-postgres/src/types/geometry/polygon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl PgPolygon {
128128
.into());
129129
}
130130

131-
if bytes.len() % BYTE_WIDTH * 2 != 0 {
131+
if bytes.len() % (BYTE_WIDTH * 2) != 0 {
132132
return Err(format!(
133133
"data length not divisible by pairs of {BYTE_WIDTH}: {}",
134134
bytes.len()

0 commit comments

Comments
 (0)