File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ pub use self::value::Value;
31
31
pub use self :: sql_operator:: SQLOperator ;
32
32
33
33
/// Like `vec.join(", ")`, but for any types implementing ToString.
34
- fn comma_separated_string < T : ToString > ( vec : & Vec < T > ) -> String {
34
+ fn comma_separated_string < T : ToString > ( vec : & [ T ] ) -> String {
35
35
vec. iter ( )
36
- . map ( |a| a . to_string ( ) )
36
+ . map ( T :: to_string)
37
37
. collect :: < Vec < String > > ( )
38
38
. join ( ", " )
39
39
}
@@ -432,8 +432,8 @@ impl ToString for SQLStatement {
432
432
selection,
433
433
} => {
434
434
let mut s = format ! ( "UPDATE {}" , table_name. to_string( ) ) ;
435
- if assignments. len ( ) > 0 {
436
- s += & format ! ( "{}" , comma_separated_string( assignments) ) ;
435
+ if ! assignments. is_empty ( ) {
436
+ s += & comma_separated_string ( assignments) ;
437
437
}
438
438
if let Some ( selection) = selection {
439
439
s += & format ! ( " WHERE {}" , selection. to_string( ) ) ;
You can’t perform that action at this time.
0 commit comments