@@ -12,10 +12,10 @@ pub enum TopLevel<'a> {
1212impl fmt:: Display for TopLevel < ' _ > {
1313 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1414 match self {
15- TopLevel :: Import ( imp) => write ! ( f, "{}" , imp ) ,
16- TopLevel :: Class ( cls) => write ! ( f, "{}" , cls ) ,
17- TopLevel :: Module ( m) => write ! ( f, "{}" , m ) ,
18- TopLevel :: Predicate ( pred) => write ! ( f, "{}" , pred ) ,
15+ TopLevel :: Import ( imp) => write ! ( f, "{imp}" ) ,
16+ TopLevel :: Class ( cls) => write ! ( f, "{cls}" ) ,
17+ TopLevel :: Module ( m) => write ! ( f, "{m}" ) ,
18+ TopLevel :: Predicate ( pred) => write ! ( f, "{pred}" ) ,
1919 }
2020 }
2121}
@@ -30,7 +30,7 @@ impl fmt::Display for Import<'_> {
3030 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
3131 write ! ( f, "import {}" , & self . module) ?;
3232 if let Some ( name) = & self . alias {
33- write ! ( f, " as {}" , name ) ?;
33+ write ! ( f, " as {name}" ) ?;
3434 }
3535 Ok ( ( ) )
3636 }
@@ -48,7 +48,7 @@ pub struct Class<'a> {
4848impl fmt:: Display for Class < ' _ > {
4949 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5050 if let Some ( qldoc) = & self . qldoc {
51- write ! ( f, "/** {} */" , qldoc ) ?;
51+ write ! ( f, "/** {qldoc } */" ) ?;
5252 }
5353 if self . is_abstract {
5454 write ! ( f, "abstract " ) ?;
@@ -58,7 +58,7 @@ impl fmt::Display for Class<'_> {
5858 if index > 0 {
5959 write ! ( f, ", " ) ?;
6060 }
61- write ! ( f, "{}" , supertype ) ?;
61+ write ! ( f, "{supertype}" ) ?;
6262 }
6363 writeln ! ( f, " {{ " ) ?;
6464
@@ -81,7 +81,7 @@ impl fmt::Display for Class<'_> {
8181 }
8282
8383 for predicate in & self . predicates {
84- writeln ! ( f, " {}" , predicate ) ?;
84+ writeln ! ( f, " {predicate}" ) ?;
8585 }
8686
8787 write ! ( f, "}}" ) ?;
@@ -101,7 +101,7 @@ pub struct Module<'a> {
101101impl fmt:: Display for Module < ' _ > {
102102 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
103103 if let Some ( qldoc) = & self . qldoc {
104- write ! ( f, "/** {} */" , qldoc ) ?;
104+ write ! ( f, "/** {qldoc } */" ) ?;
105105 }
106106 if let Some ( overlay_annotation) = & self . overlay {
107107 write ! ( f, "overlay[" ) ?;
@@ -113,7 +113,7 @@ impl fmt::Display for Module<'_> {
113113 }
114114 writeln ! ( f, "module {} {{ " , self . name) ?;
115115 for decl in & self . body {
116- writeln ! ( f, " {}" , decl ) ?;
116+ writeln ! ( f, " {decl}" ) ?;
117117 }
118118 write ! ( f, "}}" ) ?;
119119 Ok ( ( ) )
@@ -140,8 +140,8 @@ impl fmt::Display for Type<'_> {
140140 match self {
141141 Type :: Int => write ! ( f, "int" ) ,
142142 Type :: String => write ! ( f, "string" ) ,
143- Type :: Normal ( name) => write ! ( f, "{}" , name ) ,
144- Type :: At ( name) => write ! ( f, "@{}" , name ) ,
143+ Type :: Normal ( name) => write ! ( f, "{name}" ) ,
144+ Type :: At ( name) => write ! ( f, "@{name}" ) ,
145145 }
146146 }
147147}
@@ -169,16 +169,16 @@ pub enum Expression<'a> {
169169impl fmt:: Display for Expression < ' _ > {
170170 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
171171 match self {
172- Expression :: Var ( x) => write ! ( f, "{}" , x ) ,
173- Expression :: String ( s) => write ! ( f, "\" {}\" " , s ) ,
174- Expression :: Integer ( n) => write ! ( f, "{}" , n ) ,
172+ Expression :: Var ( x) => write ! ( f, "{x}" ) ,
173+ Expression :: String ( s) => write ! ( f, "\" {s }\" " ) ,
174+ Expression :: Integer ( n) => write ! ( f, "{n}" ) ,
175175 Expression :: Pred ( n, args) => {
176- write ! ( f, "{}(" , n ) ?;
176+ write ! ( f, "{n }(" ) ?;
177177 for ( index, arg) in args. iter ( ) . enumerate ( ) {
178178 if index > 0 {
179179 write ! ( f, ", " ) ?;
180180 }
181- write ! ( f, "{}" , arg ) ?;
181+ write ! ( f, "{arg}" ) ?;
182182 }
183183 write ! ( f, ")" )
184184 }
@@ -190,7 +190,7 @@ impl fmt::Display for Expression<'_> {
190190 if index > 0 {
191191 write ! ( f, " and " ) ?;
192192 }
193- write ! ( f, "({})" , conjunct ) ?;
193+ write ! ( f, "({conjunct })" ) ?;
194194 }
195195 Ok ( ( ) )
196196 }
@@ -203,19 +203,19 @@ impl fmt::Display for Expression<'_> {
203203 if index > 0 {
204204 write ! ( f, " or " ) ?;
205205 }
206- write ! ( f, "({})" , disjunct ) ?;
206+ write ! ( f, "({disjunct })" ) ?;
207207 }
208208 Ok ( ( ) )
209209 }
210210 }
211- Expression :: Equals ( a, b) => write ! ( f, "{} = {}" , a , b ) ,
211+ Expression :: Equals ( a, b) => write ! ( f, "{a } = {b}" ) ,
212212 Expression :: Dot ( x, member_pred, args) => {
213- write ! ( f, "{}.{}(" , x , member_pred ) ?;
213+ write ! ( f, "{x }.{member_pred }(" ) ?;
214214 for ( index, arg) in args. iter ( ) . enumerate ( ) {
215215 if index > 0 {
216216 write ! ( f, ", " ) ?;
217217 }
218- write ! ( f, "{}" , arg ) ?;
218+ write ! ( f, "{arg}" ) ?;
219219 }
220220 write ! ( f, ")" )
221221 }
@@ -226,26 +226,26 @@ impl fmt::Display for Expression<'_> {
226226 expr,
227227 second_expr,
228228 } => {
229- write ! ( f, "{}(" , name ) ?;
229+ write ! ( f, "{name }(" ) ?;
230230 if !vars. is_empty ( ) {
231231 for ( index, var) in vars. iter ( ) . enumerate ( ) {
232232 if index > 0 {
233233 write ! ( f, ", " ) ?;
234234 }
235- write ! ( f, "{}" , var ) ?;
235+ write ! ( f, "{var}" ) ?;
236236 }
237237 write ! ( f, " | " ) ?;
238238 }
239239 if let Some ( range) = range {
240- write ! ( f, "{} | " , range ) ?;
240+ write ! ( f, "{range } | " ) ?;
241241 }
242- write ! ( f, "{}" , expr ) ?;
242+ write ! ( f, "{expr}" ) ?;
243243 if let Some ( second_expr) = second_expr {
244- write ! ( f, ", {}" , second_expr ) ?;
244+ write ! ( f, ", {second_expr}" ) ?;
245245 }
246246 write ! ( f, ")" )
247247 }
248- Expression :: Negation ( e) => write ! ( f, "not ({})" , e ) ,
248+ Expression :: Negation ( e) => write ! ( f, "not ({e })" ) ,
249249 }
250250 }
251251}
@@ -272,7 +272,7 @@ pub struct Predicate<'a> {
272272impl fmt:: Display for Predicate < ' _ > {
273273 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
274274 if let Some ( qldoc) = & self . qldoc {
275- write ! ( f, "/** {} */" , qldoc ) ?;
275+ write ! ( f, "/** {qldoc } */" ) ?;
276276 }
277277 if let Some ( overlay_annotation) = & self . overlay {
278278 write ! ( f, "overlay[" ) ?;
@@ -293,14 +293,14 @@ impl fmt::Display for Predicate<'_> {
293293 }
294294 match & self . return_type {
295295 None => write ! ( f, "predicate " ) ?,
296- Some ( return_type) => write ! ( f, "{} " , return_type ) ?,
296+ Some ( return_type) => write ! ( f, "{return_type } " ) ?,
297297 }
298298 write ! ( f, "{}(" , self . name) ?;
299299 for ( index, param) in self . formal_parameters . iter ( ) . enumerate ( ) {
300300 if index > 0 {
301301 write ! ( f, ", " ) ?;
302302 }
303- write ! ( f, "{}" , param ) ?;
303+ write ! ( f, "{param}" ) ?;
304304 }
305305 write ! ( f, ") {{ {} }}" , self . body) ?;
306306
0 commit comments