chore: make clippy lint happy (#225)

* chore: make clippy happy

* chore: cargo fmt

* chore: cargo fmt
This commit is contained in:
Cluas
2022-11-10 02:04:31 +08:00
committed by GitHub
parent 4bd5717ab1
commit dfa26ec6f8
13 changed files with 167 additions and 207 deletions

View File

@@ -175,7 +175,7 @@ impl Server {
+ sasl_response.len() as i32, // length of SASL response
);
res.put_slice(&format!("{}\0", SCRAM_SHA_256).as_bytes()[..]);
res.put_slice(format!("{}\0", SCRAM_SHA_256).as_bytes());
res.put_i32(sasl_response.len() as i32);
res.put(sasl_response);
@@ -315,19 +315,19 @@ impl Server {
let mut server = Server {
address: address.clone(),
read: BufReader::new(read),
write: write,
write,
buffer: BytesMut::with_capacity(8196),
server_info: server_info,
server_id: server_id,
process_id: process_id,
secret_key: secret_key,
server_info,
server_id,
process_id,
secret_key,
in_transaction: false,
data_available: false,
bad: false,
needs_cleanup: false,
client_server_map: client_server_map,
client_server_map,
connected_at: chrono::offset::Utc::now().naive_utc(),
stats: stats,
stats,
application_name: String::new(),
last_activity: SystemTime::now(),
};
@@ -371,7 +371,7 @@ impl Server {
bytes.put_i32(process_id);
bytes.put_i32(secret_key);
Ok(write_all(&mut stream, bytes).await?)
write_all(&mut stream, bytes).await
}
/// Send messages to the server from the client.
@@ -616,7 +616,7 @@ impl Server {
self.needs_cleanup = false;
}
return Ok(());
Ok(())
}
/// A shorthand for `SET application_name = $1`.
@@ -631,7 +631,7 @@ impl Server {
.query(&format!("SET application_name = '{}'", name))
.await?);
self.needs_cleanup = needs_cleanup_before;
return result;
result
} else {
Ok(())
}