From b82ff5be01ebfc5eb613d62841b9a66da8ac7c41 Mon Sep 17 00:00:00 2001 From: ibraheemdev Date: Mon, 19 Apr 2021 09:49:49 -0400 Subject: [PATCH] accept owned strings in TestRequest::param --- src/test.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test.rs b/src/test.rs index c2e456e58..03e97239c 100644 --- a/src/test.rs +++ b/src/test.rs @@ -1,6 +1,6 @@ //! Various helpers for Actix applications to use during testing. -use std::{net::SocketAddr, rc::Rc}; +use std::{borrow::Cow, net::SocketAddr, rc::Rc}; pub use actix_http::test::TestBuffer; use actix_http::{ @@ -454,7 +454,11 @@ impl TestRequest { } /// Set request path pattern parameter - pub fn param(mut self, name: &'static str, value: &'static str) -> Self { + pub fn param( + mut self, + name: impl Into>, + value: impl Into>, + ) -> Self { self.path.add_static(name, value); self }