From a0e1c2cd7a310b9b6dec23de8154623424af90b5 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Mon, 31 Jan 2022 22:06:02 +0000 Subject: [PATCH] fix doc test --- actix-router/src/resource.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/actix-router/src/resource.rs b/actix-router/src/resource.rs index d6b27f7cf..f3eaa9f42 100644 --- a/actix-router/src/resource.rs +++ b/actix-router/src/resource.rs @@ -651,11 +651,11 @@ impl ResourceDef { /// ``` /// use actix_router::{Path, ResourceDef}; /// - /// fn try_match(resource: &ResourceDef, resource: &mut Path<&str>) -> bool { + /// fn try_match(resource: &ResourceDef, path: &mut Path<&str>) -> bool { /// let admin_allowed = std::env::var("ADMIN_ALLOWED").is_ok(); /// /// resource.capture_match_info_fn( - /// resource, + /// path, /// // when env var is not set, reject when path contains "admin" /// |res| !(!admin_allowed && res.path().contains("admin")), /// ) @@ -1147,9 +1147,8 @@ pub(crate) fn insert_slash(path: &str) -> Cow<'_, str> { #[cfg(test)] mod tests { - use crate::Path; - use super::*; + use crate::Path; #[test] fn equivalence() {