File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -350,8 +350,7 @@ fn read_data_row<R: BufRead>(buf: &mut R) -> io::Result<BackendMessage> {
350
350
let val = match try!( buf. read_i32 :: < BigEndian > ( ) ) {
351
351
-1 => None ,
352
352
len => {
353
- let mut data = Vec :: with_capacity ( len as usize ) ;
354
- data. extend ( ( 0 ..len) . map ( |_| 0 ) ) ;
353
+ let mut data = vec ! [ 0 ; len as usize ] ;
355
354
try!( util:: read_all ( buf, & mut data) ) ;
356
355
Some ( data)
357
356
}
@@ -402,7 +401,7 @@ fn read_row_description<R: BufRead>(buf: &mut R) -> io::Result<BackendMessage> {
402
401
type_oid : try!( buf. read_u32 :: < BigEndian > ( ) ) ,
403
402
type_size : try!( buf. read_i16 :: < BigEndian > ( ) ) ,
404
403
type_modifier : try!( buf. read_i32 :: < BigEndian > ( ) ) ,
405
- format : try!( buf. read_i16 :: < BigEndian > ( ) )
404
+ format : try!( buf. read_i16 :: < BigEndian > ( ) ) ,
406
405
} )
407
406
}
408
407
Original file line number Diff line number Diff line change @@ -210,6 +210,6 @@ impl fmt::Display for DbError {
210
210
211
211
impl error:: Error for DbError {
212
212
fn description ( & self ) -> & str {
213
- & * self . message
213
+ & self . message
214
214
}
215
215
}
You can’t perform that action at this time.
0 commit comments