build: specify clippy denies in cargo config (#1351)

* build: specify clippy denies in cargo config

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* deny implicit clone

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Ruihang Xia
2023-04-11 17:48:52 +08:00
committed by GitHub
parent d5f0ba4ad9
commit 6b6617f9cb
16 changed files with 33 additions and 23 deletions

View File

@@ -115,7 +115,7 @@ impl MysqlInstanceShim {
fn query(&self, stmt_id: u32) -> Option<String> {
let guard = self.prepared_stmts.read();
guard.get(&stmt_id).map(|s| s.to_owned())
guard.get(&stmt_id).cloned()
}
}

View File

@@ -339,7 +339,7 @@ impl ExtendedQueryHandler for PostgresServerHandler {
let (_, sql) = portal.statement().statement();
// manually replace variables in prepared statement
let mut sql = sql.to_owned();
let mut sql = sql.clone();
for i in 0..portal.parameter_len() {
sql = sql.replace(&format!("${}", i + 1), &parameter_to_string(portal, i)?);
}

View File

@@ -78,7 +78,7 @@ impl FromRow for MysqlTextRow {
let value = if let Some(mysql_value) = row.as_ref(i) {
match mysql_value {
MysqlValue::NULL => Value::Null,
MysqlValue::Bytes(v) => Value::from(v.to_vec()),
MysqlValue::Bytes(v) => Value::from(v.clone()),
_ => unreachable!(),
}
} else {