mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-23 22:51:07 +01:00
Merge branch 'master' of github.com:actix/actix-net
This commit is contained in:
commit
c1b183e1ce
@ -19,26 +19,26 @@ impl<T, U> Router<T, U> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn recognize<R, P>(&self, reosurce: &mut R) -> Option<(&T, ResourceId)>
|
pub fn recognize<R, P>(&self, resource: &mut R) -> Option<(&T, ResourceId)>
|
||||||
where
|
where
|
||||||
R: Resource<P>,
|
R: Resource<P>,
|
||||||
P: ResourcePath,
|
P: ResourcePath,
|
||||||
{
|
{
|
||||||
for item in self.0.iter() {
|
for item in self.0.iter() {
|
||||||
if item.0.match_path(reosurce.resource_path()) {
|
if item.0.match_path(resource.resource_path()) {
|
||||||
return Some((&item.1, ResourceId(item.0.id())));
|
return Some((&item.1, ResourceId(item.0.id())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn recognize_mut<R, P>(&mut self, reosurce: &mut R) -> Option<(&mut T, ResourceId)>
|
pub fn recognize_mut<R, P>(&mut self, resource: &mut R) -> Option<(&mut T, ResourceId)>
|
||||||
where
|
where
|
||||||
R: Resource<P>,
|
R: Resource<P>,
|
||||||
P: ResourcePath,
|
P: ResourcePath,
|
||||||
{
|
{
|
||||||
for item in self.0.iter_mut() {
|
for item in self.0.iter_mut() {
|
||||||
if item.0.match_path(reosurce.resource_path()) {
|
if item.0.match_path(resource.resource_path()) {
|
||||||
return Some((&mut item.1, ResourceId(item.0.id())));
|
return Some((&mut item.1, ResourceId(item.0.id())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user