Skip to content

Commit

Permalink
delete needless return
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuke-ota committed May 23, 2020
1 parent d19800f commit 070fbe1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/wildcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use http_types::{Method, StatusCode, Url};
use tide::{http, Request};

async fn add_one(cx: Request<()>) -> Result<String, tide::Error> {
return match cx.param::<i64>("num") {
match cx.param::<i64>("num") {
Ok(num) => Ok((num + 1).to_string()),
Err(err) => Err(tide::Error::new(StatusCode::BadRequest, err)),
};
}
}

async fn add_two(cx: Request<()>) -> Result<String, tide::Error> {
Expand All @@ -23,17 +23,17 @@ async fn add_two(cx: Request<()>) -> Result<String, tide::Error> {
}

async fn echo_path(cx: Request<()>) -> Result<String, tide::Error> {
return match cx.param::<String>("path") {
match cx.param::<String>("path") {
Ok(path) => Ok(path),
Err(err) => Err(tide::Error::new(StatusCode::BadRequest, err)),
};
}
}

async fn echo_empty(cx: Request<()>) -> Result<String, tide::Error> {
return match cx.param::<String>("") {
match cx.param::<String>("") {
Ok(path) => Ok(path),
Err(err) => Err(tide::Error::new(StatusCode::BadRequest, err)),
};
}
}

#[async_std::test]
Expand Down

0 comments on commit 070fbe1

Please sign in to comment.