Skip to content

Commit 468073b

Browse files
committed
Fix clippy lints in comma_separated_string
1 parent 8c7e1d1 commit 468073b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/sqlast/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ pub use self::value::Value;
3131
pub use self::sql_operator::SQLOperator;
3232

3333
/// 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 {
3535
vec.iter()
36-
.map(|a| a.to_string())
36+
.map(T::to_string)
3737
.collect::<Vec<String>>()
3838
.join(", ")
3939
}
@@ -432,8 +432,8 @@ impl ToString for SQLStatement {
432432
selection,
433433
} => {
434434
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);
437437
}
438438
if let Some(selection) = selection {
439439
s += &format!(" WHERE {}", selection.to_string());

0 commit comments

Comments
 (0)