mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-04 21:37:58 +03:00
Remove unused code
This commit is contained in:
parent
6b35f10c2f
commit
961591d77f
3 changed files with 15 additions and 19 deletions
|
@ -500,6 +500,18 @@ mod tests {
|
||||||
tree.insert(&ResourceDef::new("/name/"), 2);
|
tree.insert(&ResourceDef::new("/name/"), 2);
|
||||||
assert_eq!(tree.find(&mut Path::new("/name")), Some(1));
|
assert_eq!(tree.find(&mut Path::new("/name")), Some(1));
|
||||||
assert_eq!(tree.find(&mut Path::new("/name/")), Some(2));
|
assert_eq!(tree.find(&mut Path::new("/name/")), Some(2));
|
||||||
|
|
||||||
|
let mut tree = Tree::new(&ResourceDef::new(""), 1);
|
||||||
|
tree.insert(&ResourceDef::new("/test/index.html"), 2);
|
||||||
|
assert_eq!(tree.find_checked(&mut Path::new(""), &|_, _| true), Some(1));
|
||||||
|
assert_eq!(
|
||||||
|
tree.find_checked(&mut Path::new("index.html"), &|_, _| true),
|
||||||
|
None
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
tree.find_checked(&mut Path::new("test/index.html"), &|_, _| true),
|
||||||
|
Some(2)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -247,23 +247,7 @@ impl Tree {
|
||||||
return Some(v);
|
return Some(v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item::Subtree(ref tree) => {
|
_ => continue,
|
||||||
let result = tree.find_inner_wrapped(
|
|
||||||
"",
|
|
||||||
resource,
|
|
||||||
check,
|
|
||||||
1,
|
|
||||||
&mut segments,
|
|
||||||
insensitive,
|
|
||||||
base_skip,
|
|
||||||
);
|
|
||||||
if let Some((val, skip)) = result {
|
|
||||||
let path = resource.resource_path();
|
|
||||||
path.segments = segments;
|
|
||||||
path.skip += skip as u16;
|
|
||||||
return Some(val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -446,11 +446,11 @@ where
|
||||||
}
|
}
|
||||||
// stop io tasks and call upgrade service
|
// stop io tasks and call upgrade service
|
||||||
State::Upgrade(ref mut req) => {
|
State::Upgrade(ref mut req) => {
|
||||||
log::trace!("switching to upgrade service");
|
|
||||||
|
|
||||||
let io = this.inner.io.take();
|
let io = this.inner.io.take();
|
||||||
let req = req.take().unwrap();
|
let req = req.take().unwrap();
|
||||||
|
|
||||||
|
log::trace!("switching to upgrade service for {:?}", req);
|
||||||
|
|
||||||
// Handle UPGRADE request
|
// Handle UPGRADE request
|
||||||
crate::rt::spawn(this.inner.config.upgrade.as_ref().unwrap().call((
|
crate::rt::spawn(this.inner.config.upgrade.as_ref().unwrap().call((
|
||||||
req,
|
req,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue