Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
WT-MM committed Dec 6, 2024
1 parent 034ed01 commit 9510acf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
4 changes: 2 additions & 2 deletions daemon/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ async fn main() -> Result<()> {

let timestamp = Local::now().format("%Y%m%d_%H%M%S");
let temp_name = format!("kos-daemon_{}.log", timestamp);
let final_name = format!("kos-daemon_{}.log.gz", timestamp);
let final_name = format!("{}.gz", temp_name);
let log_path = log_dir.join(&final_name);

info!("Writing compressed logs to: {}", log_path.display());
Expand Down Expand Up @@ -240,7 +240,7 @@ async fn main() -> Result<()> {
};

// Setup signal handler
let (shutdown_tx, mut shutdown_rx) = tokio::sync::oneshot::channel();
let (shutdown_tx, shutdown_rx) = tokio::sync::oneshot::channel();

tokio::spawn(async move {
if let Ok(()) = signal::ctrl_c().await {
Expand Down
1 change: 0 additions & 1 deletion kos_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pub use grpc_interface::google as google_proto;
pub use grpc_interface::kos as kos_proto;

use async_trait::async_trait;
use eyre::Result;
use hal::actuator_service_server::ActuatorServiceServer;
use hal::imu_service_server::ImuServiceServer;
use hal::process_manager_service_server::ProcessManagerServiceServer;
Expand Down
9 changes: 3 additions & 6 deletions kos_core/src/services/krec_logger.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use crate::kos_proto::{
actuator::ActuatorStateResponse,
imu::{ImuValuesResponse, QuaternionResponse},
};
use crate::kos_proto::imu::{ImuValuesResponse, QuaternionResponse};
use eyre::Result;
use krec::{
ActuatorCommand, ActuatorState, ImuQuaternion, ImuValues, KRec, KRecFrame, KRecHeader, Vec3,
Expand Down Expand Up @@ -178,7 +175,7 @@ impl TelemetryLogger {
tracing::error!("Failed to decode QuaternionResponse {:?}", payload);
}
} else if topic.contains("/actuator/state") {
match serde_json::from_slice::<ActuatorStateList>(&payload) {
match serde_json::from_slice::<ActuatorStateList>(payload) {
Ok(state_list) => {
for state in state_list.data {
frame.actuator_states.push(ActuatorState {
Expand All @@ -198,7 +195,7 @@ impl TelemetryLogger {
}
}
} else if topic.contains("/actuator/command") {
match serde_json::from_slice::<ActuatorCommandData>(&payload) {
match serde_json::from_slice::<ActuatorCommandData>(payload) {
Ok(command_data) => {
frame.inference_step = command_data.inference_step;
frame.video_timestamp = command_data.video_timestamp;
Expand Down
7 changes: 0 additions & 7 deletions platforms/stub/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ pub use imu::*;
pub use process_manager::*;

use async_trait::async_trait;
use eyre::Result;
use kos_core::hal::Operation;
use kos_core::kos_proto::{
actuator::actuator_service_server::ActuatorServiceServer,
imu::imu_service_server::ImuServiceServer,
process_manager::process_manager_service_server::ProcessManagerServiceServer,
};
use kos_core::services::{ActuatorServiceImpl, IMUServiceImpl, ProcessManagerServiceImpl};
use kos_core::{services::OperationsServiceImpl, Platform, ServiceEnum};
use std::future::Future;
use std::pin::Pin;
Expand Down
6 changes: 6 additions & 0 deletions platforms/stub/src/process_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ pub struct StubProcessManager {
kclip_uuid: Mutex<Option<String>>,
}

impl Default for StubProcessManager {
fn default() -> Self {
Self::new()
}
}

impl StubProcessManager {
pub fn new() -> Self {
StubProcessManager {
Expand Down

0 comments on commit 9510acf

Please sign in to comment.