1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 17:07:01 +02:00

Fix scope resource path extractor #234

This commit is contained in:
Nikolay Kim
2018-05-20 17:04:08 -07:00
parent f32e8f22c8
commit 082ff46041
4 changed files with 88 additions and 0 deletions

View File

@@ -58,6 +58,16 @@ impl<'a> Params<'a> {
self.0.push((name, value));
}
pub(crate) fn remove(&mut self, name: &str)
{
for idx in (0..self.0.len()).rev() {
if self.0[idx].0 == name {
self.0.remove(idx);
return
}
}
}
/// Check if there are any matched patterns
pub fn is_empty(&self) -> bool {
self.0.is_empty()