@@ -4511,30 +4511,21 @@ impl fmt::Display for Statement {
45114511 options,
45124512 query,
45134513 } => {
4514- if table_flag. is_some ( ) {
4515- write ! (
4516- f,
4517- "CACHE {table_flag} TABLE {table_name}" ,
4518- table_flag = table_flag. clone( ) . unwrap( ) ,
4519- table_name = table_name,
4520- ) ?;
4514+ if let Some ( table_flag) = table_flag {
4515+ write ! ( f, "CACHE {table_flag} TABLE {table_name}" ) ?;
45214516 } else {
4522- write ! ( f, "CACHE TABLE {table_name}" , ) ?;
4517+ write ! ( f, "CACHE TABLE {table_name}" ) ?;
45234518 }
45244519
45254520 if !options. is_empty ( ) {
45264521 write ! ( f, " OPTIONS({})" , display_comma_separated( options) ) ?;
45274522 }
45284523
4529- let has_query = query. is_some ( ) ;
4530- if * has_as && has_query {
4531- write ! ( f, " AS {query}" , query = query. clone( ) . unwrap( ) )
4532- } else if !has_as && has_query {
4533- write ! ( f, " {query}" , query = query. clone( ) . unwrap( ) )
4534- } else if * has_as && !has_query {
4535- write ! ( f, " AS" )
4536- } else {
4537- Ok ( ( ) )
4524+ match ( * has_as, query) {
4525+ ( true , Some ( query) ) => write ! ( f, " AS {query}" ) ,
4526+ ( true , None ) => f. write_str ( " AS" ) ,
4527+ ( false , Some ( query) ) => write ! ( f, " {query}" ) ,
4528+ ( false , None ) => Ok ( ( ) ) ,
45384529 }
45394530 }
45404531 Statement :: UNCache {
0 commit comments