diff --git a/Cargo.lock b/Cargo.lock index b89f7a4..d115cc4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,7 +9,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3672c180e71eeaaac3a541fbbc5f5ad4def8b747c595ad30d674e43049f7b0" dependencies = [ "ab_glyph_rasterizer", - "owned_ttf_parser 0.25.0", + "owned_ttf_parser", ] [[package]] @@ -236,13 +236,11 @@ dependencies = [ "serde", "serde_json", "serde_path_to_error", - "serde_urlencoded", "sync_wrapper 1.0.2", "tokio", "tower", "tower-layer", "tower-service", - "tracing", ] [[package]] @@ -263,7 +261,6 @@ dependencies = [ "sync_wrapper 1.0.2", "tower-layer", "tower-service", - "tracing", ] [[package]] @@ -346,11 +343,9 @@ dependencies = [ "jpeg-encoder", "ndarray", "num_cpus", - "nvml-wrapper", "ort", "raw-cpuid", "reqwest 0.12.9", - "rusttype", "serde", "serde_yaml", "smallvec", @@ -645,41 +640,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core", - "quote", - "syn", -] - [[package]] name = "deflate64" version = "0.1.9" @@ -1081,7 +1041,6 @@ dependencies = [ "futures", "indicatif", "log", - "native-tls", "num_cpus", "rand", "reqwest 0.11.27", @@ -1089,7 +1048,6 @@ dependencies = [ "serde_json", "thiserror 1.0.69", "tokio", - "ureq", ] [[package]] @@ -1420,12 +1378,6 @@ dependencies = [ "syn", ] -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" version = "1.0.3" @@ -1986,29 +1938,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" -[[package]] -name = "nvml-wrapper" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9bff0aa1d48904a1385ea2a8b97576fbdcbc9a3cfccd0d31fe978e1c4038c5" -dependencies = [ - "bitflags 2.6.0", - "libloading", - "nvml-wrapper-sys", - "static_assertions", - "thiserror 1.0.69", - "wrapcenum-derive", -] - -[[package]] -name = "nvml-wrapper-sys" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "698d45156f28781a4e79652b6ebe2eaa0589057d588d3aec1333f6466f13fcb5" -dependencies = [ - "libloading", -] - [[package]] name = "object" version = "0.36.5" @@ -2101,22 +2030,13 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "owned_ttf_parser" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e6affeb1632d6ff6a23d2cd40ffed138e82f1532571a26f527c8a284bb2fbb" -dependencies = [ - "ttf-parser 0.15.2", -] - [[package]] name = "owned_ttf_parser" version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec719bbf3b2a81c109a4e20b1f129b5566b7dce654bc3872f6a05abf82b2c4" dependencies = [ - "ttf-parser 0.25.1", + "ttf-parser", ] [[package]] @@ -2566,16 +2486,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "rusttype" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff8374aa04134254b7995b63ad3dc41c7f7236f69528b28553da7d72efaa967" -dependencies = [ - "ab_glyph_rasterizer", - "owned_ttf_parser 0.15.2", -] - [[package]] name = "rustversion" version = "1.0.18" @@ -2805,12 +2715,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "strsim" version = "0.11.1" @@ -3144,7 +3048,6 @@ dependencies = [ "tokio", "tower-layer", "tower-service", - "tracing", ] [[package]] @@ -3165,7 +3068,6 @@ version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3235,12 +3137,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "ttf-parser" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b3e06c9b9d80ed6b745c7159c40b311ad2916abb34a49e9be2653b90db0d8dd" - [[package]] name = "ttf-parser" version = "0.25.1" @@ -3298,12 +3194,9 @@ dependencies = [ "base64 0.22.1", "flate2", "log", - "native-tls", "once_cell", "rustls", "rustls-pki-types", - "serde", - "serde_json", "url", "webpki-roots", ] @@ -3794,18 +3687,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wrapcenum-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76ff259533532054cfbaefb115c613203c73707017459206380f03b3b3f266e" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "write16" version = "1.0.0" diff --git a/Cargo.toml b/Cargo.toml index 935ece5..95d5ab5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,64 +5,62 @@ edition = "2021" [dependencies] -windows = { version = "0.58", features = ["Win32_Foundation", "Win32_System_Threading"] } ab_glyph = "0" anyhow = "1" -axum = { version = "0", features = ["multipart"] } +axum = { version = "0", default-features = false, features = [ + "http1", + "json", + "multipart", + "tokio", +] } bytes = "1" +clap = { version = "4", default-features = false, features = [ + "color", + "derive", + "error-context", + "help", + "std", + "suggestions", + "usage", +] } chrono = "0" fast_image_resize = "5" -futures = "0" -hf-hub = { version = "0", features = ["tokio"] } +futures = { version = "0", default-features = false } +hf-hub = { version = "0", default-features = false, features = ["tokio"] } image = "0" imageproc = "0" indicatif = "0" jpeg-encoder = "0" ndarray = "*" num_cpus = "1" -nvml-wrapper = "0" -ort = {version = "2.0.0-rc.9", default-features = false, features = ["ndarray", "load-dynamic", "directml"]} +ort = { version = "2.0.0-rc.9", default-features = false, features = [ + "ndarray", + "load-dynamic", + "directml", +] } raw-cpuid = "11" reqwest = { version = "0", features = ["stream", "multipart", "json"] } -rusttype = "0" serde = "1" serde_yaml = "*" -smallvec = {version = "1", features = ["union"]} -tracing = {version = "0"} +smallvec = { version = "1", features = ["union"] } +tracing = { version = "0" } tracing-appender = "0" -tracing-subscriber = {version = "0"} +tracing-subscriber = { version = "0" } +tokio = { version = "1", default-features = false, features = ["signal"] } +tokio-util = { version = "0", features = ["codec"] } uuid = { version = "1", features = ["v4"] } zune-core = "0" zune-jpeg = "0" -clap = {version = "4", default-features = false, features = [ - "derive", - "color", - "error-context", - "help", - "std", - "suggestions", - "usage" - ]} - -tokio = { version = "1", features = [ - "fs", - "io-util", - "macros", - "rt-multi-thread", - "signal", - "sync", -] } -tokio-util = { version = "0", features = ["codec"] } - [target.'cfg(windows)'.dependencies] ansi_term = "0" -windows = { version = "0", features = [ +windows = { version = "0", default-features = false, features = [ "Win32_Foundation", "Win32_Graphics_Dxgi", "Win32_Graphics_Dxgi_Common", "Win32_Graphics_Direct3D", "Win32_Graphics_Direct3D12", + "Win32_System_Threading", ] } [build-dependencies] @@ -73,4 +71,4 @@ zip = "*" opt-level = 3 lto = true strip = true -codegen-units = 1 \ No newline at end of file +codegen-units = 1 diff --git a/src/api.rs b/src/api.rs index 0aa161d..caf14fa 100644 --- a/src/api.rs +++ b/src/api.rs @@ -1,5 +1,4 @@ use std::fmt::Debug; - use axum::body::Bytes; use serde::{Deserialize, Serialize}; diff --git a/src/server.rs b/src/server.rs index 673f428..28b44c3 100644 --- a/src/server.rs +++ b/src/server.rs @@ -16,8 +16,7 @@ use std::{ sync::{mpsc::Sender, Arc}, time::Instant, }; -use tokio::sync::oneshot; -use tokio::time::{timeout, Duration}; +use tokio::{sync::oneshot, time::{timeout, Duration}}; use tokio_util::sync::CancellationToken; use tracing::{error, info, warn};