Skip to content

Commit f0dc882

Browse files
committed
chore: use const
1 parent f32a7b8 commit f0dc882

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

rust/cubesql/pg-srv/src/protocol.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,7 @@ mod tests {
13091309
);
13101310

13111311
assert_eq!(
1312-
body.to_bind_values(&ParameterDescription::new(vec![PgTypeId::FLOAT8]))
1313-
.unwrap(),
1312+
body.to_bind_values(&ParameterDescription::new(vec![PgTypeId::FLOAT8]))?,
13141313
vec![BindValue::Float64(3.14)]
13151314
);
13161315
}
@@ -1332,16 +1331,13 @@ mod tests {
13321331
FrontendMessage::Bind(body) => {
13331332
assert_eq!(body.parameter_formats, vec![Format::Binary]);
13341333

1335-
let values = body
1336-
.to_bind_values(&ParameterDescription::new(vec![PgTypeId::FLOAT8]))
1337-
.unwrap();
1334+
let values =
1335+
body.to_bind_values(&ParameterDescription::new(vec![PgTypeId::FLOAT8]))?;
13381336

1339-
match &values[0] {
1340-
BindValue::Float64(val) => {
1341-
assert!((val - 3.14).abs() < 0.0001);
1342-
}
1343-
_ => panic!("Expected Float64 bind value"),
1344-
}
1337+
assert_eq!(
1338+
body.to_bind_values(&ParameterDescription::new(vec![PgTypeId::FLOAT8]))?,
1339+
vec![BindValue::Float64(3.14)]
1340+
);
13451341
}
13461342
_ => panic!("Wrong message, must be Bind"),
13471343
}

0 commit comments

Comments
 (0)