mirror of
https://github.com/zerotier/ratpack.git
synced 2026-05-22 16:27:23 -07:00
remove #[allow(dead_code)] annotations
Signed-off-by: Erik Hollensbe <linux@hollensbe.org>
This commit is contained in:
+1
-3
@@ -45,8 +45,7 @@ impl Path {
|
||||
self.clone()
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn params(&self) -> Vec<String> {
|
||||
pub fn params(&self) -> Vec<String> {
|
||||
let mut params = Vec::new();
|
||||
for arg in self.0.clone() {
|
||||
match arg {
|
||||
@@ -58,7 +57,6 @@ impl Path {
|
||||
params
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn extract(&self, provided: String) -> Result<Params, Error> {
|
||||
let parts: Vec<String> = provided
|
||||
.split("/")
|
||||
|
||||
+1
-3
@@ -42,7 +42,6 @@ impl<S: Clone + Send> Route<S> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
async fn dispatch(
|
||||
&self,
|
||||
provided: String,
|
||||
@@ -81,8 +80,7 @@ impl<S: Clone + Send> Router<S> {
|
||||
|
||||
for route in self.0.clone() {
|
||||
if route.path.matches(path.to_string()) && route.method.eq(req.method()) {
|
||||
let params = route.path.extract(path)?;
|
||||
let (_, response) = route.handler.perform(req, None, params, app).await?;
|
||||
let (_, response) = route.dispatch(path.to_string(), req, app).await?;
|
||||
if response.is_none() {
|
||||
return Err(Error::StatusCode(http::StatusCode::INTERNAL_SERVER_ERROR));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user