remove #[allow(dead_code)] annotations

Signed-off-by: Erik Hollensbe <linux@hollensbe.org>
This commit is contained in:
Erik Hollensbe
2022-01-21 09:29:01 -08:00
parent 55e351d193
commit ae27861a76
2 changed files with 2 additions and 6 deletions
+1 -3
View File
@@ -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
View File
@@ -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));
}