Clippy fixes
This commit is contained in:
@@ -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.")
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user