Skip to content

Commit a67fe64

Browse files
committed
refactor(types): simplify <&str as ToSql>::to_sql
1 parent 7dd6813 commit a67fe64

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

postgres-types/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1012,10 +1012,10 @@ impl ToSql for Vec<u8> {
10121012

10131013
impl<'a> ToSql for &'a str {
10141014
fn to_sql(&self, ty: &Type, w: &mut BytesMut) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
1015-
match *ty {
1016-
ref ty if ty.name() == "ltree" => types::ltree_to_sql(self, w),
1017-
ref ty if ty.name() == "lquery" => types::lquery_to_sql(self, w),
1018-
ref ty if ty.name() == "ltxtquery" => types::ltxtquery_to_sql(self, w),
1015+
match ty.name() {
1016+
"ltree" => types::ltree_to_sql(self, w),
1017+
"lquery" => types::lquery_to_sql(self, w),
1018+
"ltxtquery" => types::ltxtquery_to_sql(self, w),
10191019
_ => types::text_to_sql(self, w),
10201020
}
10211021
Ok(IsNull::No)

0 commit comments

Comments
 (0)