Skip to content

Commit 21ce229

Browse files
committed
Update to work with latest master
This is segfaulting for me in places that should not segfault. Not sure what's going on.
1 parent 1b00801 commit 21ce229

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl<R: Reader> ReadString for R {
230230
buf.push(byte);
231231
}
232232

233-
str::from_bytes_owned(buf)
233+
str::from_utf8_owned(buf)
234234
}
235235
}
236236

src/types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ from_conversions_impl!(PgFloat8, f64, read_be_f64_)
145145
from_option_impl!(f64)
146146

147147
from_map_impl!(PgVarchar | PgText | PgCharN, ~str, |buf| {
148-
str::from_bytes(buf.as_slice())
148+
str::from_utf8(buf.as_slice())
149149
})
150150
from_option_impl!(~str)
151151

@@ -158,12 +158,12 @@ impl FromSql for Option<~[u8]> {
158158
from_option_impl!(~[u8])
159159

160160
from_map_impl!(PgJson, Json, |buf| {
161-
json::from_str(str::from_bytes_slice(buf.as_slice())).unwrap()
161+
json::from_str(str::from_utf8_slice(buf.as_slice())).unwrap()
162162
})
163163
from_option_impl!(Json)
164164

165165
from_map_impl!(PgUuid, Uuid, |buf| {
166-
Uuid::from_bytes(buf.as_slice()).unwrap()
166+
Uuid::from_utf8(buf.as_slice()).unwrap()
167167
})
168168
from_option_impl!(Uuid)
169169

0 commit comments

Comments
 (0)