We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
<&str as ToSql>::to_sql
1 parent 7dd6813 commit a67fe64Copy full SHA for a67fe64
postgres-types/src/lib.rs
@@ -1012,10 +1012,10 @@ impl ToSql for Vec<u8> {
1012
1013
impl<'a> ToSql for &'a str {
1014
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),
+ match ty.name() {
+ "ltree" => types::ltree_to_sql(self, w),
+ "lquery" => types::lquery_to_sql(self, w),
+ "ltxtquery" => types::ltxtquery_to_sql(self, w),
1019
_ => types::text_to_sql(self, w),
1020
}
1021
Ok(IsNull::No)
0 commit comments