Clippy fixes

This commit is contained in:
mdecimus
2024-06-18 15:30:41 +02:00
parent aa4a11baf7
commit ae2a67422f
15 changed files with 459 additions and 148 deletions

View File

@@ -384,8 +384,8 @@ impl ConfigManager {
};
for (key, value) in config.keys {
if key.starts_with("version.") {
external.id = key.clone();
external.version = value.clone();
external.id.clone_from(&key);
external.version.clone_from(&value);
external.keys.push(ConfigKey::from((key, value)));
} else if key.starts_with("queue.quota.")
|| key.starts_with("queue.throttle.")

View File

@@ -145,7 +145,9 @@ impl Core {
.or_insert(cert.clone());
}
core.tls.certificates.store(certificates.into());
core.tls.self_signed_cert = self.tls.self_signed_cert.clone();
core.tls
.self_signed_cert
.clone_from(&self.tls.self_signed_cert);
// Parser servers
let mut servers = Servers::parse(&mut config);

View File

@@ -96,10 +96,7 @@ pub async fn exec(ctx: PluginContext<'_>) -> Variable {
let span = ctx.span;
let address = ctx.arguments[0].to_string();
let timeout = Duration::from_secs(std::cmp::max(
std::cmp::min(ctx.arguments[1].to_integer() as u64, 60),
5,
));
let timeout = Duration::from_secs((ctx.arguments[1].to_integer() as u64).clamp(5, 60));
// Send message to address
match pyzor_send_message(address.as_ref(), timeout, &request).await {
Ok(response) => response.into(),