Skip to content

Commit 7043875

Browse files
committed
bin/server: Simplify threads assignment
1 parent e32f2ba commit 7043875

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/bin/server.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
6464
};
6565
let threads = dotenv::var("SERVER_THREADS")
6666
.map(|s| s.parse().expect("SERVER_THREADS was not a valid number"))
67-
.unwrap_or_else(|_| {
68-
if env == Env::Development {
69-
5
70-
} else {
71-
// A large default because this can be easily changed via env and in production we
72-
// want the logging middleware to accurately record the start time.
73-
500
74-
}
67+
.unwrap_or_else(|_| match env {
68+
Env::Development => 5,
69+
// A large default because this can be easily changed via env and in production we
70+
// want the logging middleware to accurately record the start time.
71+
_ => 500,
7572
});
7673

7774
println!("Booting with a hyper based server");

0 commit comments

Comments
 (0)