1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-12-04 09:21:55 +01:00

bump MSRV to 1.42 (#180)

This commit is contained in:
Rob Ede 2020-08-17 15:37:57 +01:00 committed by GitHub
parent 5d28be9ad6
commit fb098536ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 9 deletions

View File

@ -14,7 +14,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
version: version:
- 1.39.0 - 1.42.0
- stable - stable
- nightly - nightly

View File

@ -13,8 +13,8 @@ Actix net - framework for composable network services
## Documentation & community resources ## Documentation & community resources
* [Chat on gitter](https://gitter.im/actix/actix) * [Chat on Gitter](https://gitter.im/actix/actix)
* Minimum supported Rust version: 1.39 or later * Minimum supported Rust version: 1.42 or later
## Example ## Example

View File

@ -276,7 +276,7 @@ impl ServerBuilder {
info!("Starting \"{}\" service on {}", sock.1, sock.2); info!("Starting \"{}\" service on {}", sock.1, sock.2);
} }
self.accept.start( self.accept.start(
mem::replace(&mut self.sockets, Vec::new()) mem::take(&mut self.sockets)
.into_iter() .into_iter()
.map(|t| (t.0, t.2)) .map(|t| (t.0, t.2))
.collect(), .collect(),
@ -355,7 +355,7 @@ impl ServerBuilder {
// stop accept thread // stop accept thread
self.accept.send(Command::Stop); self.accept.send(Command::Stop);
let notify = std::mem::replace(&mut self.notify, Vec::new()); let notify = std::mem::take(&mut self.notify);
// stop workers // stop workers
if !self.workers.is_empty() && graceful { if !self.workers.is_empty() && graceful {

View File

@ -58,10 +58,7 @@ impl<E: PartialEq> PartialEq for TimeoutError<E> {
TimeoutError::Service(e2) => e1 == e2, TimeoutError::Service(e2) => e1 == e2,
TimeoutError::Timeout => false, TimeoutError::Timeout => false,
}, },
TimeoutError::Timeout => match other { TimeoutError::Timeout => matches!(other, TimeoutError::Timeout),
TimeoutError::Service(_) => false,
TimeoutError::Timeout => true,
},
} }
} }
} }