File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -629,9 +629,8 @@ impl InnerPostgresConnection {
629629 fn set_type_names < ' a , I > ( & mut self , mut it : I ) -> PostgresResult < ( ) >
630630 where I : Iterator < & ' a mut PostgresType > {
631631 for ty in it {
632- match * ty {
633- PgUnknownType { oid, ref mut name } => * name = try!( self . get_type_name ( oid) ) ,
634- _ => { }
632+ if let & PgUnknownType { oid, ref mut name } = ty {
633+ * name = try!( self . get_type_name ( oid) ) ;
635634 }
636635 }
637636
Original file line number Diff line number Diff line change @@ -243,9 +243,8 @@ impl<W: Writer> WriteMessage for W {
243243 }
244244 }
245245
246- match ident {
247- Some ( ident) => try!( self . write_u8 ( ident) ) ,
248- None => ( )
246+ if let Some ( ident) = ident {
247+ try!( self . write_u8 ( ident) ) ;
249248 }
250249
251250 let buf = buf. unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -337,17 +337,14 @@ impl<T> Range<T> where T: PartialOrd+Normalizable{
337337 let lower = lower. map ( Normalizable :: normalize) ;
338338 let upper = upper. map ( Normalizable :: normalize) ;
339339
340- match ( & lower, & upper) {
341- ( & Some ( ref lower) , & Some ( ref upper) ) => {
342- let empty = match ( lower. type_ , upper. type_ ) {
343- ( Inclusive , Inclusive ) => lower. value > upper. value ,
344- _ => lower. value >= upper. value
345- } ;
346- if empty {
347- return Range { inner : Empty } ;
348- }
340+ if let ( & Some ( ref lower) , & Some ( ref upper) ) = ( & lower, & upper) {
341+ let empty = match ( lower. type_ , upper. type_ ) {
342+ ( Inclusive , Inclusive ) => lower. value > upper. value ,
343+ _ => lower. value >= upper. value
344+ } ;
345+ if empty {
346+ return Range { inner : Empty } ;
349347 }
350- _ => { }
351348 }
352349
353350 Range { inner : Normal ( lower, upper) }
You can’t perform that action at this time.
0 commit comments