From a6b2127b0c0e46b457487f360bb8c4be36388d66 Mon Sep 17 00:00:00 2001 From: hex Date: Tue, 29 Jul 2025 12:35:23 +0200 Subject: [PATCH] chore: remove unused imports --- src/db.rs | 4 ++-- src/main.rs | 8 +++----- src/services/api.rs | 3 +-- src/services/controller.rs | 9 +++------ 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/db.rs b/src/db.rs index 86c691d..0fdccba 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1,9 +1,9 @@ use std::{ error::Error, - net::{IpAddr, SocketAddr}, + net::IpAddr, }; -use tokio_postgres::{Client, Socket, tls::MakeTlsConnect}; +use tokio_postgres::Client; const ENDPOINT_TABLE: &str = "endpoints"; const HOSTS_RELATION_TABLE: &str = "hosts"; diff --git a/src/main.rs b/src/main.rs index 42844c7..8ded716 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,16 +5,14 @@ mod services; use std::{env, sync::Arc}; -use bcrypt::{DEFAULT_COST, bcrypt}; +use bcrypt::DEFAULT_COST; use config::Config; use db::BoxyDatabase; use log::{error, info}; -use nanoid::nanoid; -use ring::rand::SystemRandom; use server::Server; use services::{api::ApiService, controller::ControllerService}; -use tokio::{fs::File, io::AsyncReadExt, sync::Mutex}; -use tokio_postgres::{NoTls, tls::NoTlsError}; +use tokio::sync::Mutex; +use tokio_postgres::NoTls; const VERSION: &str = "v0.1a"; diff --git a/src/services/api.rs b/src/services/api.rs index a3dce19..cab3cac 100644 --- a/src/services/api.rs +++ b/src/services/api.rs @@ -1,14 +1,13 @@ use std::{net::IpAddr, pin::Pin, sync::Arc}; use base64::{Engine, prelude::BASE64_STANDARD}; -use bcrypt::bcrypt; use http_body_util::{BodyExt, Full}; use hyper::{ Method, Request, Response, StatusCode, body::{Bytes, Incoming}, service::Service, }; -use log::{debug, info, warn}; +use log::{debug, warn}; use tokio::{net::TcpStream, sync::Mutex}; use crate::{ diff --git a/src/services/controller.rs b/src/services/controller.rs index b892b20..7665ac7 100644 --- a/src/services/controller.rs +++ b/src/services/controller.rs @@ -1,18 +1,15 @@ use std::{pin::Pin, sync::Arc}; -use http_body_util::Full; use hyper::{ - Request, Response, - body::{Bytes, Incoming}, + Request, + body::Incoming, service::Service, }; -use log::error; use tokio::sync::Mutex; use crate::{ - config::{self, Client, Config, Host}, db::{BoxyDatabase, Endpoint}, - server::{GeneralBody, GeneralResponse, TcpIntercept}, + server::{GeneralResponse, TcpIntercept}, }; use super::proxy::ProxyService;