@@ -40,8 +40,11 @@ use serde::{Deserialize, Serialize};
4040#[ cfg( feature = "visitor" ) ]
4141use sqlparser_derive:: { Visit , VisitMut } ;
4242
43- use crate :: keywords:: Keyword ;
4443use crate :: tokenizer:: { Span , Token } ;
44+ use crate :: {
45+ display_utils:: { Indent , NewLine } ,
46+ keywords:: Keyword ,
47+ } ;
4548
4649pub use self :: data_type:: {
4750 ArrayElemTypeDef , BinaryLength , CharLengthUnits , CharacterLength , DataType , EnumMember ,
@@ -134,9 +137,9 @@ where
134137 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
135138 let mut delim = "" ;
136139 for t in self . slice {
137- write ! ( f , "{ delim}" ) ?;
140+ f . write_str ( delim) ?;
138141 delim = self . sep ;
139- write ! ( f , "{t}" ) ?;
142+ t . fmt ( f ) ?;
140143 }
141144 Ok ( ( ) )
142145 }
@@ -4219,7 +4222,8 @@ impl fmt::Display for Statement {
42194222 } => {
42204223 write ! ( f, "FLUSH" ) ?;
42214224 if let Some ( location) = location {
4222- write ! ( f, " {location}" ) ?;
4225+ f. write_str ( " " ) ?;
4226+ location. fmt ( f) ?;
42234227 }
42244228 write ! ( f, " {object_type}" ) ?;
42254229
@@ -4301,7 +4305,7 @@ impl fmt::Display for Statement {
43014305
43024306 write ! ( f, "{statement}" )
43034307 }
4304- Statement :: Query ( s) => write ! ( f , "{s}" ) ,
4308+ Statement :: Query ( s) => s . fmt ( f ) ,
43054309 Statement :: Declare { stmts } => {
43064310 write ! ( f, "DECLARE " ) ?;
43074311 write ! ( f, "{}" , display_separated( stmts, "; " ) )
0 commit comments