diff options
author | Vika <vika@fireburn.ru> | 2021-12-05 23:00:01 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2021-12-05 23:00:01 +0300 |
commit | 4aa7f01da39ab55b4f6346e7565d8bb29566de39 (patch) | |
tree | 125c147e1a39dfebc4be1a3ac3a6dd8fadb3855e /src/lib.rs | |
parent | c0b552318cb08872c7deae82a10122b0e16b7ae8 (diff) | |
download | kittybox-4aa7f01da39ab55b4f6346e7565d8bb29566de39.tar.zst |
Code cleanup and small bugfixing in templates
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs index 108a42f..817bda7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,8 +4,8 @@ use tide::{Request, Response}; pub mod database; mod frontend; mod indieauth; -mod micropub; mod metrics; +mod micropub; use crate::indieauth::IndieAuthMiddleware; use crate::micropub::CORSMiddleware; @@ -110,21 +110,25 @@ pub async fn get_app_with_file( } #[cfg(test)] -pub async fn get_app_with_test_file(token_endpoint: surf::Url) -> ( +pub async fn get_app_with_test_file( + token_endpoint: surf::Url, +) -> ( tempdir::TempDir, database::FileStorage, - App<database::FileStorage> + App<database::FileStorage>, ) { use surf::Url; let tempdir = tempdir::TempDir::new("file").expect("Failed to create tempdir"); - let backend = database::FileStorage::new(tempdir.path().to_path_buf()).await.unwrap(); + let backend = database::FileStorage::new(tempdir.path().to_path_buf()) + .await + .unwrap(); let app = tide::with_state(ApplicationState { token_endpoint, media_endpoint: None, authorization_endpoint: Url::parse("https://indieauth.com/auth").unwrap(), storage: backend.clone(), internal_token: None, - http_client: surf::Client::new() + http_client: surf::Client::new(), }); (tempdir, backend, equip_app(app)) } |