From f795a49d51cd2ef3605abc94e3cb2c337b9a14c0 Mon Sep 17 00:00:00 2001 From: Petard Jonson Date: Thu, 9 Jan 2025 21:42:29 +0800 Subject: [PATCH] fix: lint fix: lint fix: lint --- nyanpasu_service/src/server/routing/network.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/nyanpasu_service/src/server/routing/network.rs b/nyanpasu_service/src/server/routing/network.rs index 52ff37a..1d07323 100644 --- a/nyanpasu_service/src/server/routing/network.rs +++ b/nyanpasu_service/src/server/routing/network.rs @@ -1,7 +1,10 @@ use axum::{http::StatusCode, routing::post, Json, Router}; -use nyanpasu_ipc::api::network::set_dns::{ - NetworkSetDnsReq, NetworkSetDnsRes, NETWORK_SET_DNS_ENDPOINT, +use nyanpasu_ipc::api::{ + network::set_dns::{NetworkSetDnsReq, NetworkSetDnsRes, NETWORK_SET_DNS_ENDPOINT}, + RBuilder, }; +use std::borrow::Cow; + #[cfg(target_os = "macos")] use nyanpasu_utils::network::macos::{get_default_network_hardware_port, set_dns}; @@ -13,10 +16,6 @@ pub fn setup() -> Router { pub async fn network( Json(mut req): Json>, ) -> (StatusCode, Json>) { - use std::borrow::Cow; - - use nyanpasu_ipc::api::RBuilder; - let default_interface = match get_default_network_hardware_port() { Ok(interface) => interface, Err(e) => { @@ -45,6 +44,6 @@ pub async fn network( ) -> (StatusCode, Json>) { ( StatusCode::NOT_IMPLEMENTED, - Json(RBuilder::not_implemented()), + Json(RBuilder::other_error(Cow::Borrowed("Not implemented"))), ) }