1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 00:50:20 +02:00

Impl From<usize> and From<Option<usize>> for KeepAlive

This commit is contained in:
messense
2018-03-10 17:40:36 +08:00
parent 3dd8fdf450
commit 9a404a0c03
3 changed files with 30 additions and 4 deletions

View File

@@ -124,8 +124,8 @@ impl<H> HttpServer<H> where H: IntoHttpHandler + 'static
/// Set server keep-alive setting.
///
/// By default keep alive is set to a `Os`.
pub fn keep_alive(mut self, val: KeepAlive) -> Self {
self.keep_alive = val;
pub fn keep_alive<T: Into<KeepAlive>>(mut self, val: T) -> Self {
self.keep_alive = val.into();
self
}