Skip to content

Commit e569ed4

Browse files
committed
fix warnings
1 parent f13541a commit e569ed4

10 files changed

Lines changed: 405 additions & 433 deletions

File tree

crates/api/src/devbox.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ impl DevboxSessionRpc for DevboxSessionRpcServer {
793793
.ok_or_else(|| "Workload not found".to_string())?;
794794

795795
let port_mappings: Vec<lapdev_devbox_rpc::PortMapping> =
796-
serde_json::from_value(serde_json::Value::from(intercept.port_mappings.clone()))
796+
serde_json::from_value(intercept.port_mappings.clone())
797797
.map_err(|e| format!("Failed to parse port mappings: {}", e))?;
798798

799799
result.push(lapdev_devbox_rpc::WorkloadInterceptInfo {

crates/api/src/devbox_tunnels.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ pub(crate) fn split_axum_websocket(
155155
let (sink, stream) = socket.split();
156156

157157
let sink = sink
158-
.sink_map_err(|err| io::Error::other(err))
158+
.sink_map_err(io::Error::other)
159159
.with(|message: TungMessage| future::ready(map_tungstenite_to_axum(message)));
160160

161161
let stream = stream.filter_map(|msg| {

crates/api/src/kube_controller/deployment.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ impl KubeController {
1212
workloads_with_resources: lapdev_kube_rpc::KubeWorkloadsWithResources,
1313
extra_labels: Option<HashMap<String, String>>,
1414
) -> Result<(), ApiError> {
15-
let workloads_with_resources = workloads_with_resources;
1615
let namespace = &environment.namespace;
1716
let environment_name = &environment.name;
1817

crates/api/src/kube_controller/environment.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl KubeController {
138138
)
139139
.collect();
140140

141-
let total_pages = (total_count + pagination.page_size - 1) / pagination.page_size;
141+
let total_pages = total_count.div_ceil(pagination.page_size);
142142

143143
Ok(PaginatedResult {
144144
data: kube_environments,
@@ -579,7 +579,7 @@ impl KubeController {
579579
pub async fn delete_kube_environment(
580580
&self,
581581
org_id: Uuid,
582-
user_id: Uuid,
582+
_user_id: Uuid,
583583
environment_id: Uuid,
584584
) -> Result<(), ApiError> {
585585
// Authorize deletion (HRPC already enforced ownership/role, so we just ensure the environment exists and belongs to the org)
@@ -732,8 +732,8 @@ impl KubeController {
732732

733733
pub async fn pause_kube_environment(
734734
&self,
735-
org_id: Uuid,
736-
user_id: Uuid,
735+
_org_id: Uuid,
736+
_user_id: Uuid,
737737
environment_id: Uuid,
738738
) -> Result<(), ApiError> {
739739
let environment = self
@@ -2327,12 +2327,10 @@ impl KubeController {
23272327
// Only insert/update workloads that were actually deployed
23282328
for workload in workloads_to_deploy {
23292329
let details = &workload.details;
2330-
let containers_json = serde_json::to_value(&details.containers)
2331-
.map(Json::from)
2332-
.unwrap_or_else(|_| Json::from(serde_json::json!([])));
2333-
let ports_json = serde_json::to_value(&details.ports)
2334-
.map(Json::from)
2335-
.unwrap_or_else(|_| Json::from(serde_json::json!([])));
2330+
let containers_json =
2331+
serde_json::to_value(&details.containers).unwrap_or_else(|_| serde_json::json!([]));
2332+
let ports_json =
2333+
serde_json::to_value(&details.ports).unwrap_or_else(|_| serde_json::json!([]));
23362334
let workload_yaml = details.workload_yaml.clone();
23372335

23382336
let existing_workload = lapdev_db_entities::kube_environment_workload::Entity::find()

crates/api/src/kube_controller/workload.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ impl KubeController {
214214

215215
pub async fn update_environment_workload(
216216
&self,
217-
org_id: Uuid,
218-
user_id: Uuid,
217+
_org_id: Uuid,
218+
_user_id: Uuid,
219219
workload_id: Uuid,
220220
containers: Vec<lapdev_common::kube::KubeContainerInfo>,
221221
environment: lapdev_db_entities::kube_environment::Model,

crates/conductor/src/scheduler.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ mod tests {
299299
use std::collections::HashSet;
300300

301301
use chrono::Utc;
302-
use lapdev_common::{utils, PrebuildStatus, WorkspaceHostStatus, WorkspaceStatus};
303302
use lapdev_db::tests::prepare_db;
304303
use sea_orm::{ActiveModelTrait, ActiveValue, TransactionTrait};
305304
use uuid::Uuid;

0 commit comments

Comments
 (0)