Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
fix: lint

fix: lint
  • Loading branch information
greenhat616 committed Jan 9, 2025
1 parent 0cbf000 commit f795a49
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions nyanpasu_service/src/server/routing/network.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand All @@ -13,10 +16,6 @@ pub fn setup() -> Router {
pub async fn network(
Json(mut req): Json<NetworkSetDnsReq<'static>>,
) -> (StatusCode, Json<NetworkSetDnsRes<'static>>) {
use std::borrow::Cow;

use nyanpasu_ipc::api::RBuilder;

let default_interface = match get_default_network_hardware_port() {
Ok(interface) => interface,
Err(e) => {
Expand Down Expand Up @@ -45,6 +44,6 @@ pub async fn network(
) -> (StatusCode, Json<NetworkSetDnsRes<'static>>) {
(
StatusCode::NOT_IMPLEMENTED,
Json(RBuilder::not_implemented()),
Json(RBuilder::other_error(Cow::Borrowed("Not implemented"))),
)
}

0 comments on commit f795a49

Please sign in to comment.