From 3827a835eff128020120856175787bba6d813791 Mon Sep 17 00:00:00 2001 From: John Gallagher Date: Mon, 29 May 2017 11:20:28 -0400 Subject: [PATCH] Add ToSql impls for str and [u8]. --- src/types/to_sql.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/types/to_sql.rs b/src/types/to_sql.rs index 9543a49..21236a1 100644 --- a/src/types/to_sql.rs +++ b/src/types/to_sql.rs @@ -94,12 +94,24 @@ impl ToSql for String { } } +impl ToSql for str { + fn to_sql(&self) -> Result { + Ok(ToSqlOutput::from(self)) + } +} + impl ToSql for Vec { fn to_sql(&self) -> Result { Ok(ToSqlOutput::from(self.as_slice())) } } +impl ToSql for [u8] { + fn to_sql(&self) -> Result { + Ok(ToSqlOutput::from(self)) + } +} + impl ToSql for Value { fn to_sql(&self) -> Result { Ok(ToSqlOutput::from(self))