From 9c1bda3eca294ec644154f8a619f221e72f12a90 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sun, 29 Apr 2018 19:49:26 -0700 Subject: [PATCH] fix stable compiler compatibility --- src/application.rs | 8 ++++---- src/scope.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/application.rs b/src/application.rs index 7de2a258..6c0482aa 100644 --- a/src/application.rs +++ b/src/application.rs @@ -319,10 +319,10 @@ where /// } /// ``` /// - /// In the above example three routes get registered: - /// * /app/path1 - reponds to all http method - /// * /app/path2 - `GET` requests - /// * /app/path3 - `HEAD` requests + /// In the above example, three routes get added: + /// * /app/path1 + /// * /app/path2 + /// * /app/path3 /// pub fn scope(mut self, path: &str, f: F) -> App where diff --git a/src/scope.rs b/src/scope.rs index eae5d55a..b671eaac 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -184,7 +184,7 @@ impl RouteHandler for Scope { let path = unsafe { &*(&req.match_info()["tail"] as *const _) }; let path = if path == "" { "/" } else { path }; - for (pattern, resource) in self.resources.iter() { + for &(ref pattern, ref resource) in self.resources.iter() { if pattern.match_with_params(path, req.match_info_mut()) { let default = unsafe { &mut *self.default.as_ref().get() };