fix: remove unused imports and dead code
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -12,8 +12,6 @@ use tower_http::cors::CorsLayer;
|
|||||||
use tower::ServiceBuilder;
|
use tower::ServiceBuilder;
|
||||||
use tower_http::trace::TraceLayer;
|
use tower_http::trace::TraceLayer;
|
||||||
|
|
||||||
use crate::Args;
|
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
mod api;
|
mod api;
|
||||||
mod docs;
|
mod docs;
|
||||||
@@ -37,14 +35,13 @@ pub fn mode_server(
|
|||||||
let rt = tokio::runtime::Runtime::new()?;
|
let rt = tokio::runtime::Runtime::new()?;
|
||||||
// Take ownership of the connection and move it into the async runtime
|
// Take ownership of the connection and move it into the async runtime
|
||||||
let owned_conn = std::mem::replace(conn, rusqlite::Connection::open_in_memory()?);
|
let owned_conn = std::mem::replace(conn, rusqlite::Connection::open_in_memory()?);
|
||||||
rt.block_on(run_server(config, owned_conn, data_path, args))
|
rt.block_on(run_server(config, owned_conn, data_path))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn run_server(
|
async fn run_server(
|
||||||
config: ServerConfig,
|
config: ServerConfig,
|
||||||
conn: rusqlite::Connection,
|
conn: rusqlite::Connection,
|
||||||
data_dir: PathBuf,
|
data_dir: PathBuf,
|
||||||
args: &Args,
|
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
debug!("Starting REST HTTP server on {}", config.address);
|
debug!("Starting REST HTTP server on {}", config.address);
|
||||||
|
|
||||||
@@ -55,7 +52,6 @@ async fn run_server(
|
|||||||
db: db_conn,
|
db: db_conn,
|
||||||
data_dir: data_dir.clone(),
|
data_dir: data_dir.clone(),
|
||||||
password: config.password.clone(),
|
password: config.password.clone(),
|
||||||
args: Arc::new(args.clone()),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ use axum::{
|
|||||||
http::header,
|
http::header,
|
||||||
};
|
};
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use serde_json::json;
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ pub mod item;
|
|||||||
pub mod status;
|
pub mod status;
|
||||||
|
|
||||||
use axum::{
|
use axum::{
|
||||||
routing::{get, post, delete},
|
routing::get,
|
||||||
Router,
|
Router,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ pub struct AppState {
|
|||||||
pub db: Arc<Mutex<rusqlite::Connection>>,
|
pub db: Arc<Mutex<rusqlite::Connection>>,
|
||||||
pub data_dir: PathBuf,
|
pub data_dir: PathBuf,
|
||||||
pub password: Option<String>,
|
pub password: Option<String>,
|
||||||
pub args: Arc<Args>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
|
|||||||
Reference in New Issue
Block a user