@@ -83,8 +83,8 @@ impl<T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'_, '_, T, A>
8383
8484 return_orderby. push ( SortField :: new (
8585 expr,
86- asc. map_or ( true , |asc| asc) ,
87- nulls_first. map_or ( false , |first| first) ,
86+ asc. is_none_or ( |asc| asc) ,
87+ nulls_first. is_some_and ( |first| first) ,
8888 ) ) ;
8989 }
9090 Some ( return_orderby)
@@ -251,8 +251,7 @@ impl<T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'_, '_, T, A>
251251
252252 if !group_raw_exprs. iter ( ) . contains ( & expr) {
253253 return Err ( DatabaseError :: AggMiss ( format ! (
254- "`{}` must appear in the GROUP BY clause or be used in an aggregate function" ,
255- expr
254+ "`{expr}` must appear in the GROUP BY clause or be used in an aggregate function"
256255 ) ) ) ;
257256 }
258257 }
@@ -306,12 +305,9 @@ impl<T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'_, '_, T, A>
306305 return Ok ( ( ) ) ;
307306 }
308307
309- Err ( DatabaseError :: AggMiss (
310- format ! (
311- "expression '{}' must appear in the GROUP BY clause or be used in an aggregate function" ,
312- expr
313- )
314- ) )
308+ Err ( DatabaseError :: AggMiss ( format ! (
309+ "expression '{expr}' must appear in the GROUP BY clause or be used in an aggregate function"
310+ ) ) )
315311 }
316312 ScalarExpression :: ColumnRef { .. } | ScalarExpression :: Alias { .. } => {
317313 if self . context . group_by_exprs . contains ( expr) {
@@ -321,12 +317,9 @@ impl<T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'_, '_, T, A>
321317 return self . validate_having_orderby ( expr. unpack_alias_ref ( ) ) ;
322318 }
323319
324- Err ( DatabaseError :: AggMiss (
325- format ! (
326- "expression '{}' must appear in the GROUP BY clause or be used in an aggregate function" ,
327- expr
328- )
329- ) )
320+ Err ( DatabaseError :: AggMiss ( format ! (
321+ "expression '{expr}' must appear in the GROUP BY clause or be used in an aggregate function"
322+ ) ) )
330323 }
331324
332325 ScalarExpression :: TypeCast { expr, .. } => self . validate_having_orderby ( expr) ,
0 commit comments