diff options
author | Vika Shleina <vika@fireburn.ru> | 2021-07-15 04:46:22 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2021-07-19 04:57:11 +0300 |
commit | dc490adb60db3d560e54cafe28ebf1f8ba1731b6 (patch) | |
tree | 8806c22c711e41cb478df2f969da4bdd69d2b9bc /src/micropub | |
parent | d399fd0bd00c9ea073e5b057de70c9ffdd9356f8 (diff) | |
download | kittybox-dc490adb60db3d560e54cafe28ebf1f8ba1731b6.tar.zst |
make clippy happy
Diffstat (limited to 'src/micropub')
-rw-r--r-- | src/micropub/get.rs | 10 | ||||
-rw-r--r-- | src/micropub/post.rs | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/micropub/get.rs b/src/micropub/get.rs index 525bf12..5db99f7 100644 --- a/src/micropub/get.rs +++ b/src/micropub/get.rs @@ -40,21 +40,21 @@ where Ok(chans) => channels = chans, Err(err) => return Ok(err.into()) } - return Ok(Response::builder(200).body(json!(channels)).build()) + Ok(Response::builder(200).body(json!(channels)).build()) } "source" => { if user.check_scope("create") || user.check_scope("update") || user.check_scope("delete") || user.check_scope("undelete") { if let Some(url) = query.url { match backend.get_post(&url).await { Ok(post) => if let Some(post) = post { - return Ok(Response::builder(200).body(post).build()) + Ok(Response::builder(200).body(post).build()) } else { - return Ok(Response::builder(404).build()) + Ok(Response::builder(404).build()) }, - Err(err) => return Ok(err.into()) + Err(err) => Ok(err.into()) } } else { - return Ok(Response::builder(400).body(json!({ + Ok(Response::builder(400).body(json!({ "error": "invalid_request", "error_description": "Please provide `url`." })).build()) diff --git a/src/micropub/post.rs b/src/micropub/post.rs index edadeed..639346b 100644 --- a/src/micropub/post.rs +++ b/src/micropub/post.rs @@ -271,10 +271,10 @@ pub async fn new_post<S: Storage>( // do background processing on the post async_std::task::spawn(post_process_new_post(req, post)); - return Ok(Response::builder(202) + Ok(Response::builder(202) .header("Location", &uid) .body(json!({"status": "accepted", "location": &uid})) - .build()); + .build()) } async fn create_feed( @@ -519,7 +519,7 @@ async fn process_json<S: Storage>( if let Err(error) = req.state().storage.delete_post(&url).await { return Ok(error.into()); } - return Ok(Response::builder(200).build()); + Ok(Response::builder(200).build()) } "update" => { if !user.check_scope("update") { @@ -530,9 +530,9 @@ async fn process_json<S: Storage>( ); } if let Err(error) = req.state().storage.update_post(&url, body.clone()).await { - return Ok(error.into()); + Ok(error.into()) } else { - return Ok(Response::builder(204).build()); + Ok(Response::builder(204).build()) } } _ => return error_json!(400, "invalid_request", "This action is not supported."), |