mirror of
https://github.com/fafhrd91/actix-net
synced 2025-02-06 22:35:54 +01:00
remove get_decoded
This commit is contained in:
parent
34995a8ccf
commit
43ad18ccb1
@ -159,25 +159,6 @@ impl<T: ResourcePath> Path<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "http")]
|
|
||||||
use std::borrow::Cow;
|
|
||||||
|
|
||||||
#[cfg(feature = "http")]
|
|
||||||
impl Path<crate::Url> {
|
|
||||||
/// Get URL-decoded matched parameter by name without type conversion
|
|
||||||
pub fn get_decoded(&self, key: &str) -> Option<Cow<str>> {
|
|
||||||
use crate::url::RESERVED_QUOTER;
|
|
||||||
|
|
||||||
self.get(key).map(|value| {
|
|
||||||
if let Some(value) = RESERVED_QUOTER.with(|q| q.requote(value.as_bytes())) {
|
|
||||||
Cow::Owned(value)
|
|
||||||
} else {
|
|
||||||
Cow::Borrowed(value)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct PathIter<'a, T> {
|
pub struct PathIter<'a, T> {
|
||||||
idx: usize,
|
idx: usize,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user