Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
43209a4925
|
|||
4114b388ca
|
|||
2de132b835
|
|||
03d636fecc
|
|||
390a6bddfd
|
|||
00e3817677
|
|||
2841c69e71
|
|||
02998ba067
|
|||
7f54021e3e
|
|||
f318948b94
|
|||
49a82d90f4
|
|||
5c3f67b7b0
|
|||
8a8d418d5c
|
|||
268032a86e
|
|||
2ef2865614
|
|||
1b69509f8c
|
|||
3d8def56a3
|
|||
a4fa0d7ee3
|
|||
974d0ed72c
|
|||
7f749e6c6d
|
|||
c92734913a
|
558
Cargo.lock
generated
558
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
10
Cargo.toml
10
Cargo.toml
@ -1,8 +1,16 @@
|
||||
[package]
|
||||
name = "expose-dir-via-http"
|
||||
version = "1.0.0"
|
||||
version = "1.0.8"
|
||||
edition = "2021"
|
||||
|
||||
[lints.rust]
|
||||
unsafe_code = "forbid"
|
||||
|
||||
[lints.clippy]
|
||||
pedantic = { level = "warn", priority = -1 }
|
||||
todo = "warn"
|
||||
unwrap_used = "warn"
|
||||
|
||||
[dependencies]
|
||||
actix-web = { version = "4", features = ["experimental-io-uring"] }
|
||||
actix-files = "0.6"
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user