mirror of https://github.com/fafhrd91/actix-web
accept owned strings in TestRequest::param
This commit is contained in:
parent
52bb2b5daf
commit
b82ff5be01
|
@ -1,6 +1,6 @@
|
||||||
//! Various helpers for Actix applications to use during testing.
|
//! 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;
|
pub use actix_http::test::TestBuffer;
|
||||||
use actix_http::{
|
use actix_http::{
|
||||||
|
@ -454,7 +454,11 @@ impl TestRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set request path pattern parameter
|
/// 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<Cow<'static, str>>,
|
||||||
|
value: impl Into<Cow<'static, str>>,
|
||||||
|
) -> Self {
|
||||||
self.path.add_static(name, value);
|
self.path.add_static(name, value);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue