1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-27 15:42:57 +01:00

assert workers greater than zero (#167)

This commit is contained in:
Adrian Wechner 2020-08-18 10:44:22 -05:00 committed by GitHub
parent 578a560853
commit fecdfcd8d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,11 @@
# Changes
## Unreleased
### Changed
* workers must be greater than 0
## [1.0.3] - 2020-05-19
### Changed

View File

@ -72,8 +72,9 @@ impl ServerBuilder {
/// Set number of workers to start.
///
/// By default server uses number of available logical cpu as workers
/// count.
/// count. Workers must be greater than 0.
pub fn workers(mut self, num: usize) -> Self {
assert_ne!(num, 0, "workers must be greater than 0");
self.threads = num;
self
}