Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix all clippy suggestions on the new version #245

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
branches: [ "main", "v[0-9]+.[0-9]+" ]

env:
# Disabling debug info and incremental builds to speed up builds a bunch.
# See https://matklad.github.io/2021/09/04/fast-rust-builds.html#CI-Workflow
CARGO_INCREMENTAL: 0
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_TERM_COLOR: always

jobs:
Expand Down Expand Up @@ -70,5 +74,7 @@ jobs:
run: make all
- name: Build wws on release mode
run: cargo build --verbose --release
- name: Compile test
run: cargo test --no-run --locked
- name: Test
run: cargo test --workspace -- --show-output
2 changes: 1 addition & 1 deletion crates/api-manage/src/models/worker_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl From<&Worker> for WorkerConfig {
.map(WorkerFolder::from)
.collect::<Vec<WorkerFolder>>()
})
.unwrap_or(Vec::new());
.unwrap_or_default();

Self {
id: value.id.clone(),
Expand Down
4 changes: 2 additions & 2 deletions crates/project/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ pub async fn prepare_project(
force_type: Option<ProjectType>,
options: Options,
) -> Result<PathBuf> {
let project_type = if force_type.is_some() {
force_type.unwrap()
let project_type = if let Some(new_type) = force_type {
new_type
} else {
identify_type(location)?
};
Expand Down
2 changes: 1 addition & 1 deletion crates/runtimes/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//// Copyright 2022 VMware, Inc.
// Copyright 2022-2023 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0

pub mod errors;
Expand Down
14 changes: 8 additions & 6 deletions crates/server/src/handlers/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,14 @@ pub async fn handle_worker(req: HttpRequest, body: Bytes) -> HttpResponse {
}

// Write to the state if required
if handler_success && kv_namespace.is_some() {
data_connectors
.write()
.expect("error locking data connectors lock for writing")
.kv
.replace_store(&kv_namespace.unwrap(), &handler_result.kv)
if handler_success {
if let Some(kv_namespace) = kv_namespace {
data_connectors
.write()
.expect("error locking data connectors lock for writing")
.kv
.replace_store(&kv_namespace, &handler_result.kv)
}
}

match handler_result.body() {
Expand Down