Compare commits

...

2 Commits

Author SHA1 Message Date
974d0ed72c
[release] expose-dir-via-http v1.0.1 2024-04-14 08:31:54 +02:00
7f749e6c6d
[clippy] enable more lints, get rid of unwrap 2024-04-14 08:30:35 +02:00
3 changed files with 12 additions and 4 deletions

2
Cargo.lock generated
View File

@ -546,7 +546,7 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]]
name = "expose-dir-via-http"
version = "1.0.0"
version = "1.0.1"
dependencies = [
"actix-files",
"actix-web",

View File

@ -1,8 +1,16 @@
[package]
name = "expose-dir-via-http"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
[lints.rust]
unsafe_code = "forbid"
[lints.clippy]
pedantic = "warn"
todo = "warn"
unwrap_used = "warn"
[dependencies]
actix-web = { version = "4", features = ["experimental-io-uring"] }
actix-files = "0.6"

View File

@ -1,6 +1,6 @@
use std::{
env,
net::{IpAddr, SocketAddr},
num::NonZeroUsize,
thread::available_parallelism,
};
@ -39,7 +39,7 @@ async fn main() -> std::io::Result<()> {
.prefer_utf8(true),
)
})
.workers(available_parallelism().unwrap().get())
.workers(available_parallelism().map_or(1, NonZeroUsize::get))
.bind(sock)?
.run()
.await