treewide: format with nightly rustfmt; auto-fix Clippy lints
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I15d9215ab506b37954468d99746098326a6a6964
This commit is contained in:
parent
10a118bd50
commit
73919f2f9e
30 changed files with 144 additions and 151 deletions
|
|
@ -68,7 +68,7 @@ pub async fn run_nix_build_remote(
|
|||
buf
|
||||
});
|
||||
|
||||
let live_log_path_owned = live_log_path.map(|p| p.to_path_buf());
|
||||
let live_log_path_owned = live_log_path.map(std::path::Path::to_path_buf);
|
||||
let stderr_task = tokio::spawn(async move {
|
||||
let mut buf = String::new();
|
||||
let steps: Vec<SubStep> = Vec::new();
|
||||
|
|
@ -146,6 +146,7 @@ pub struct SubStep {
|
|||
|
||||
/// Parse a single nix internal JSON log line (`@nix {...}`).
|
||||
/// Returns `Some(action, drv_path)` if the line contains a derivation action.
|
||||
#[must_use]
|
||||
pub fn parse_nix_log_line(line: &str) -> Option<(&'static str, String)> {
|
||||
let json_str = line.strip_prefix("@nix ")?.trim();
|
||||
let parsed: serde_json::Value = serde_json::from_str(json_str).ok()?;
|
||||
|
|
@ -209,7 +210,7 @@ pub async fn run_nix_build(
|
|||
});
|
||||
|
||||
// Read stderr (logs + internal JSON)
|
||||
let live_log_path_owned = live_log_path.map(|p| p.to_path_buf());
|
||||
let live_log_path_owned = live_log_path.map(std::path::Path::to_path_buf);
|
||||
let stderr_task = tokio::spawn(async move {
|
||||
let mut buf = String::new();
|
||||
let mut steps: Vec<SubStep> = Vec::new();
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ pub struct WorkerPool {
|
|||
|
||||
impl WorkerPool {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[must_use]
|
||||
pub fn new(
|
||||
db_pool: PgPool,
|
||||
workers: usize,
|
||||
|
|
@ -348,7 +349,7 @@ async fn run_build(
|
|||
match result {
|
||||
Ok(build_result) => {
|
||||
// Complete the build step
|
||||
let exit_code = if build_result.success { 0 } else { 1 };
|
||||
let exit_code = i32::from(!build_result.success);
|
||||
repo::build_steps::complete(
|
||||
pool,
|
||||
step.id,
|
||||
|
|
@ -366,7 +367,7 @@ async fn run_build(
|
|||
command: format!("nix build {}", sub_step.drv_path),
|
||||
})
|
||||
.await?;
|
||||
let sub_exit = if sub_step.success { 0 } else { 1 };
|
||||
let sub_exit = i32::from(!sub_step.success);
|
||||
repo::build_steps::complete(pool, sub.id, sub_exit, None, None).await?;
|
||||
}
|
||||
|
||||
|
|
@ -476,7 +477,7 @@ async fn run_build(
|
|||
}
|
||||
|
||||
let primary_output =
|
||||
build_result.output_paths.first().map(|s| s.as_str());
|
||||
build_result.output_paths.first().map(std::string::String::as_str);
|
||||
|
||||
repo::builds::complete(
|
||||
pool,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue