@@ -237,12 +237,12 @@ impl<W: Writer> WriteMessage for W {
237237 }
238238}
239239
240- trait ReadString {
241- fn read_string ( & mut self ) -> ~str ;
240+ trait ReadCStr {
241+ fn read_cstr ( & mut self ) -> ~str ;
242242}
243243
244- impl < R : Buffer > ReadString for R {
245- fn read_string ( & mut self ) -> ~str {
244+ impl < R : Buffer > ReadCStr for R {
245+ fn read_cstr ( & mut self ) -> ~str {
246246 let mut buf = self . read_until ( 0 ) . unwrap ( ) ;
247247 buf. pop ( ) ;
248248 str:: from_utf8_owned ( buf)
@@ -268,10 +268,10 @@ impl<R: Reader> ReadMessage for R {
268268 '3' => CloseComplete ,
269269 'A' => NotificationResponse {
270270 pid : buf. read_be_i32 ( ) ,
271- channel : buf. read_string ( ) ,
272- payload : buf. read_string ( )
271+ channel : buf. read_cstr ( ) ,
272+ payload : buf. read_cstr ( )
273273 } ,
274- 'C' => CommandComplete { tag : buf. read_string ( ) } ,
274+ 'C' => CommandComplete { tag : buf. read_cstr ( ) } ,
275275 'D' => read_data_row ( & mut buf) ,
276276 'E' => ErrorResponse { fields : read_fields ( & mut buf) } ,
277277 'I' => EmptyQueryResponse ,
@@ -284,8 +284,8 @@ impl<R: Reader> ReadMessage for R {
284284 'R' => read_auth_message ( & mut buf) ,
285285 's' => PortalSuspended ,
286286 'S' => ParameterStatus {
287- parameter : buf. read_string ( ) ,
288- value : buf. read_string ( )
287+ parameter : buf. read_cstr ( ) ,
288+ value : buf. read_cstr ( )
289289 } ,
290290 't' => read_parameter_description ( & mut buf) ,
291291 'T' => read_row_description ( & mut buf) ,
@@ -306,7 +306,7 @@ fn read_fields(buf: &mut MemReader) -> ~[(u8, ~str)] {
306306 break ;
307307 }
308308
309- fields. push ( ( ty, buf. read_string ( ) ) ) ;
309+ fields. push ( ( ty, buf. read_cstr ( ) ) ) ;
310310 }
311311
312312 fields
@@ -357,7 +357,7 @@ fn read_row_description(buf: &mut MemReader) -> BackendMessage {
357357
358358 for _ in range ( 0 , len) {
359359 types. push ( RowDescriptionEntry {
360- name : buf. read_string ( ) ,
360+ name : buf. read_cstr ( ) ,
361361 table_oid : buf. read_be_i32 ( ) ,
362362 column_id : buf. read_be_i16 ( ) ,
363363 type_oid : buf. read_be_i32 ( ) ,
0 commit comments