[clippy] enable more lints, get rid of unwrap
This commit is contained in:
parent
c92734913a
commit
7f749e6c6d
@ -3,6 +3,14 @@ name = "expose-dir-via-http"
|
||||
version = "1.0.0"
|
||||
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"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user