Skip to content

Commit 2b3ae9d

Browse files
committed
fix: resolve all clippy warnings for CI
1 parent e53c44e commit 2b3ae9d

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/basilica/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ impl BasilicaClient {
325325
.iter()
326326
.filter(|o| {
327327
o.availability.unwrap_or(false)
328-
&& min_cpu.map_or(true, |c| o.vcpu_count.unwrap_or(0) >= c)
329-
&& min_memory_gb.map_or(true, |m| o.system_memory_gb.unwrap_or(0) >= m)
328+
&& min_cpu.is_none_or(|c| o.vcpu_count.unwrap_or(0) >= c)
329+
&& min_memory_gb.is_none_or(|m| o.system_memory_gb.unwrap_or(0) >= m)
330330
})
331331
.min_by(|a, b| {
332332
let rate_a: f64 = a

src/executor.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ async fn run_batch(
422422
})
423423
}
424424

425+
#[allow(clippy::too_many_arguments)]
425426
async fn run_single_task(
426427
config: &Config,
427428
task: &SweForgeTask,
@@ -817,14 +818,12 @@ async fn run_task_on_basilica(
817818
result.status = TaskStatus::InstallingDeps;
818819

819820
// Install base build tools + ensure python/pip/pytest are on PATH
820-
let base_tools = format!(
821-
"sudo apt-get update -qq && \
821+
let base_tools = "sudo apt-get update -qq && \
822822
sudo apt-get install -y -qq git curl build-essential python3 python3-pip python3-venv unzip > /dev/null 2>&1 && \
823823
sudo ln -sf /usr/bin/python3 /usr/local/bin/python 2>/dev/null; \
824824
sudo ln -sf /usr/bin/pip3 /usr/local/bin/pip 2>/dev/null; \
825825
sudo pip3 install pytest > /dev/null 2>&1 || sudo pip3 install --break-system-packages pytest > /dev/null 2>&1; \
826-
hash -r 2>/dev/null; true"
827-
);
826+
hash -r 2>/dev/null; true".to_string();
828827
let (_, _, exit) = ssh_exec(host, port, user, &base_tools, timeout, ssh_key).await?;
829828
if exit != 0 {
830829
warn!("[{}] Base tools install failed (exit {})", task.id, exit);
@@ -1012,7 +1011,7 @@ async fn run_task_on_basilica(
10121011

10131012
// Write test source files
10141013
for (name, content) in &task.test_source_files {
1015-
let escaped_content = content.replace('\'', "'\\''");
1014+
let _escaped_content = content.replace('\'', "'\\''");
10161015
let remote_path = format!("{work_dir}/repo/{name}");
10171016
ssh_exec(
10181017
host, port, user,
@@ -1025,7 +1024,7 @@ async fn run_task_on_basilica(
10251024
let mut test_results: Vec<TaskTestResult> = Vec::new();
10261025
for (name, content) in &task.test_scripts {
10271026
let remote_script = format!("{work_dir}/repo/{name}");
1028-
let escaped = content.replace('\'', "'\\''");
1027+
let _escaped = content.replace('\'', "'\\''");
10291028
ssh_exec(
10301029
host, port, user,
10311030
&format!("mkdir -p $(dirname '{remote_script}') && cat > '{remote_script}' << 'SCRIPTEOF'\n{content}\nSCRIPTEOF\nchmod +x '{remote_script}'"),

src/handlers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,7 @@ fn get_basilica_client(
14601460
}
14611461

14621462
#[derive(serde::Deserialize)]
1463+
#[allow(dead_code)]
14631464
struct CreateContainerRequest {
14641465
#[serde(default = "default_container_type")]
14651466
container_type: String,

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
mod auth;
2+
#[allow(dead_code)]
23
mod basilica;
34
mod cleanup;
45
mod config;

0 commit comments

Comments
 (0)