@@ -1853,16 +1853,10 @@ impl fmt::Display for Expr {
18531853 negated,
18541854 } => {
18551855 let not_ = if * negated { "NOT " } else { "" } ;
1856- if form . is_none ( ) {
1857- write ! ( f, "{expr } IS {not_} NORMALIZED" )
1856+ if let Some ( form ) = form {
1857+ write ! ( f, "{} IS {}{} NORMALIZED" , expr , not_ , form )
18581858 } else {
1859- write ! (
1860- f,
1861- "{} IS {}{} NORMALIZED" ,
1862- expr,
1863- not_,
1864- form. as_ref( ) . unwrap( )
1865- )
1859+ write ! ( f, "{expr} IS {not_}NORMALIZED" )
18661860 }
18671861 }
18681862 Expr :: SimilarTo {
@@ -5741,8 +5735,8 @@ impl fmt::Display for Statement {
57415735 write ! ( f, " SESSION" ) ?;
57425736 }
57435737 write ! ( f, " STATUS" ) ?;
5744- if filter . is_some ( ) {
5745- write ! ( f, " {}" , filter. as_ref ( ) . unwrap ( ) ) ?;
5738+ if let Some ( filter ) = filter {
5739+ write ! ( f, " {}" , filter) ?;
57465740 }
57475741 Ok ( ( ) )
57485742 }
@@ -5759,8 +5753,8 @@ impl fmt::Display for Statement {
57595753 write ! ( f, " SESSION" ) ?;
57605754 }
57615755 write ! ( f, " VARIABLES" ) ?;
5762- if filter . is_some ( ) {
5763- write ! ( f, " {}" , filter. as_ref ( ) . unwrap ( ) ) ?;
5756+ if let Some ( filter ) = filter {
5757+ write ! ( f, " {}" , filter) ?;
57645758 }
57655759 Ok ( ( ) )
57665760 }
@@ -6172,8 +6166,8 @@ impl fmt::Display for Statement {
61726166 if !copy_options. options . is_empty ( ) {
61736167 write ! ( f, " COPY_OPTIONS=({copy_options})" ) ?;
61746168 }
6175- if comment . is_some ( ) {
6176- write ! ( f, " COMMENT='{}'" , comment. as_ref ( ) . unwrap ( ) ) ?;
6169+ if let Some ( comment ) = comment {
6170+ write ! ( f, " COMMENT='{}'" , comment) ?;
61776171 }
61786172 Ok ( ( ) )
61796173 }
@@ -6260,12 +6254,11 @@ impl fmt::Display for Statement {
62606254 }
62616255 Statement :: Pragma { name, value, is_eq } => {
62626256 write ! ( f, "PRAGMA {name}" ) ?;
6263- if value. is_some ( ) {
6264- let val = value. as_ref ( ) . unwrap ( ) ;
6257+ if let Some ( value) = value {
62656258 if * is_eq {
6266- write ! ( f, " = {val }" ) ?;
6259+ write ! ( f, " = {value }" ) ?;
62676260 } else {
6268- write ! ( f, "({val })" ) ?;
6261+ write ! ( f, "({value })" ) ?;
62696262 }
62706263 }
62716264 Ok ( ( ) )
0 commit comments