Compare commits

..

2 Commits

Author SHA1 Message Date
504d10bccc b 2024-04-11 10:36:34 +02:00
d9ac349d58 a 2024-04-11 10:36:22 +02:00
6 changed files with 397 additions and 555 deletions

929
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,10 @@
[package]
name = "expose-dir-via-http"
version = "1.1.13"
edition = "2024"
rust-version = "1.85"
[lints.rust]
unsafe_code = "forbid"
[lints.clippy]
pedantic = { level = "warn", priority = -1 }
todo = "warn"
unwrap_used = "warn"
version = "1.0.0"
edition = "2021"
[dependencies]
actix-web = { version = "4" }
actix-web = { version = "4", features = ["experimental-io-uring"] }
actix-files = "0.6"
clap = { version = "4", features = ["cargo", "derive"] }

0
a Normal file
View File

0
b Normal file
View File

View File

@ -1,2 +0,0 @@
[toolchain]
channel = "nightly"

View File

@ -1,11 +1,11 @@
use std::{
env,
net::{IpAddr, SocketAddr},
num::NonZeroUsize,
thread::available_parallelism,
};
use actix_web::{App, HttpServer};
use clap::{Parser, crate_name, crate_version};
use clap::{crate_name, crate_version, Parser};
#[derive(Parser, Debug)]
#[clap(name = crate_name!(), version = crate_version!())]
@ -39,7 +39,7 @@ async fn main() -> std::io::Result<()> {
.prefer_utf8(true),
)
})
.workers(available_parallelism().map_or(1, NonZeroUsize::get))
.workers(available_parallelism().unwrap().get())
.bind(sock)?
.run()
.await