Skip to content

Commit cdbbadd

Browse files
committed
Clean up some equality checks
1 parent 39a89de commit cdbbadd

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ impl RowIndex for uint {
15321532
impl<'a> RowIndex for &'a str {
15331533
#[inline]
15341534
fn idx(&self, stmt: &Statement) -> Option<uint> {
1535-
stmt.result_descriptions().iter().position(|d| &*d.name == *self)
1535+
stmt.result_descriptions().iter().position(|d| d.name == *self)
15361536
}
15371537
}
15381538

src/types/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ impl FromSql for Option<HashMap<String, Option<String>>> {
569569
fn from_sql(ty: &Type, raw: &Option<Vec<u8>>)
570570
-> Result<Option<HashMap<String, Option<String>>>> {
571571
match *ty {
572-
Type::Unknown { ref name, .. } if "hstore" == &**name => {}
572+
Type::Unknown { ref name, .. } if "hstore" == *name => {}
573573
_ => return Err(Error::WrongType(ty.clone()))
574574
}
575575

@@ -715,7 +715,7 @@ to_array_impl!(JsonArray, json::Json)
715715
impl ToSql for HashMap<String, Option<String>> {
716716
fn to_sql(&self, ty: &Type) -> Result<Option<Vec<u8>>> {
717717
match *ty {
718-
Type::Unknown { ref name, .. } if "hstore" == &**name => {}
718+
Type::Unknown { ref name, .. } if "hstore" == *name => {}
719719
_ => return Err(Error::WrongType(ty.clone()))
720720
}
721721

@@ -743,7 +743,7 @@ impl ToSql for HashMap<String, Option<String>> {
743743
impl ToSql for Option<HashMap<String, Option<String>>> {
744744
fn to_sql(&self, ty: &Type) -> Result<Option<Vec<u8>>> {
745745
match *ty {
746-
Type::Unknown { ref name, .. } if "hstore" == &**name => {}
746+
Type::Unknown { ref name, .. } if "hstore" == *name => {}
747747
_ => return Err(Error::WrongType(ty.clone()))
748748
}
749749

0 commit comments

Comments
 (0)