diff --git a/src/message.rs b/src/message.rs index 601d6963..92beca08 100644 --- a/src/message.rs +++ b/src/message.rs @@ -230,7 +230,7 @@ impl ReadString for R { buf.push(byte); } - str::from_bytes_owned(buf) + str::from_utf8_owned(buf) } } diff --git a/src/types.rs b/src/types.rs index e3bae7b0..c6095279 100644 --- a/src/types.rs +++ b/src/types.rs @@ -145,7 +145,7 @@ from_conversions_impl!(PgFloat8, f64, read_be_f64_) from_option_impl!(f64) from_map_impl!(PgVarchar | PgText | PgCharN, ~str, |buf| { - str::from_bytes(buf.as_slice()) + str::from_utf8(buf.as_slice()) }) from_option_impl!(~str) @@ -158,12 +158,12 @@ impl FromSql for Option<~[u8]> { from_option_impl!(~[u8]) from_map_impl!(PgJson, Json, |buf| { - json::from_str(str::from_bytes_slice(buf.as_slice())).unwrap() + json::from_str(str::from_utf8_slice(buf.as_slice())).unwrap() }) from_option_impl!(Json) from_map_impl!(PgUuid, Uuid, |buf| { - Uuid::from_bytes(buf.as_slice()).unwrap() + Uuid::from_utf8(buf.as_slice()).unwrap() }) from_option_impl!(Uuid)