Skip to content

Commit

Permalink
fix: improve code quality and enforce stricter linting
Browse files Browse the repository at this point in the history
- Updated `justfile` to enforce stricter linting by adding `-D warnings` to `cargo clippy`.
- Simplified boolean field initialization in `run_build.rs` by removing redundant field name.
- Replaced `format!` with `to_string` for `package_log` in `mod.rs` to improve code readability and performance.
  • Loading branch information
erikreinert committed Jun 15, 2024
1 parent 9aec066 commit 22546fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ generate:

# lint code (cargo)
lint:
cargo clippy
cargo clippy -- -D warnings

# build and install (nix)
package:
Expand Down
2 changes: 1 addition & 1 deletion src/service/build/run_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ pub async fn run(request: Request<BuildRequest>) -> Result<Response<BuildStream>

for package_chunk in package_data.chunks(response_chunks_size) {
tx.send(Ok(BuildResponse {
is_archive: is_archive,
is_archive,
package_data: package_chunk.to_vec(),
package_log: "".to_string(),
}))
Expand Down
6 changes: 3 additions & 3 deletions src/service/proxy/package/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ pub async fn prepare(

while let Some(chunk) = stream.message().await? {
tx.send(Ok(PackageResponse {
package_log: format!("{}", chunk.source_log),
package_log: chunk.source_log.to_string(),
}))
.await?;

Expand All @@ -275,7 +275,7 @@ pub async fn prepare(
}

tx.send(Ok(PackageResponse {
package_log: format!("source id: {}", source_id),
package_log: format!("source id: {}", source_id).to_string(),
}))
.await?;

Expand Down Expand Up @@ -339,7 +339,7 @@ pub async fn build(
let response = build_response?;

tx.send(Ok(PackageResponse {
package_log: format!("{}", response.package_log),
package_log: response.package_log,
}))
.await?;

Expand Down

0 comments on commit 22546fa

Please sign in to comment.