diff options
author | Vika <vika@fireburn.ru> | 2021-07-29 18:14:30 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2021-07-29 18:14:30 +0300 |
commit | 949a961c19ba994c3f0846e7b54d9a55a94d7b9a (patch) | |
tree | b9d2031e1b08dcebf8f22c6051dea4da6e4f40ab /src/lib.rs | |
parent | bd38e2f19b8c2c353ad759c1631b93b0f8eafbb0 (diff) | |
download | kittybox-949a961c19ba994c3f0846e7b54d9a55a94d7b9a.tar.zst |
Appease rustfmt, clippy and cargo check
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs index 398c3b2..6a62dcc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,8 +5,8 @@ mod frontend; mod indieauth; mod micropub; -use crate::micropub::CORSMiddleware; use crate::indieauth::IndieAuthMiddleware; +use crate::micropub::CORSMiddleware; #[derive(Clone)] pub struct ApplicationState<StorageBackend> @@ -64,7 +64,7 @@ pub async fn get_app_with_redis( authorization_endpoint: surf::Url, redis_uri: String, media_endpoint: Option<String>, - internal_token: Option<String> + internal_token: Option<String>, ) -> App<database::RedisStorage> { let app = tide::with_state(ApplicationState { token_endpoint, @@ -169,11 +169,14 @@ mod tests { .with_body(r#"{"me": "https://aaronparecki.com/", "client_id": "https://quill.p3k.io/", "scope": "create update delete media"}"#) .create(); - let mut response = app.post("/micropub") + let mut response = app + .post("/micropub") .header("Authorization", "Bearer awoo") .header("Content-Type", "application/json") .body(json!({ "action": "delete", "url": uid })) - .send().await.unwrap(); + .send() + .await + .unwrap(); println!("{}", response.body_string().await.unwrap()); assert_eq!(response.status(), 403); } @@ -215,7 +218,11 @@ mod tests { // Should be posted successfully, but... assert!(response.status() == 201 || response.status() == 202); // ...won't be available on a foreign URL - assert!(db.get_post("https://aaronparecki.com/posts/more-fake-news").await.unwrap().is_none()); + assert!(db + .get_post("https://aaronparecki.com/posts/more-fake-news") + .await + .unwrap() + .is_none()); let response = post_json(&app, json!({ "type": ["h-entry"], |