From ce0b62eae7688987b722599be8e8b2ff6764b224 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Tue, 24 May 2016 11:36:02 -0700 Subject: [PATCH] fix(server): Request.ssl() works --- src/server/request.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/server/request.rs b/src/server/request.rs index aab33e2762..e2085411a6 100644 --- a/src/server/request.rs +++ b/src/server/request.rs @@ -78,6 +78,8 @@ impl<'a, 'b: 'a> Request<'a, 'b> { /// Get a reference to the underlying Ssl stream, if connected /// over HTTPS. /// + /// This is actually just an alias for `downcast_ref`. + /// /// # Example /// /// ```rust @@ -95,11 +97,7 @@ impl<'a, 'b: 'a> Request<'a, 'b> { /// ``` #[inline] pub fn ssl(&self) -> Option<&T> { - use ::net::HttpsStream; - match self.downcast_ref() { - Some(&HttpsStream::Https(ref s)) => Some(s), - _ => None - } + self.downcast_ref() } /// Deconstruct a Request into its constituent parts.