From d36014200549cf73a7f22c6f94fb15bec17823e8 Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 29 Jan 2024 07:08:21 +0300 Subject: lint: no extra whitespace on line endings --- src/bin/kittybox-check-webmention.rs | 6 +++--- src/bin/kittybox-indieauth-helper.rs | 14 +++++++------- src/bin/kittybox-mf2.rs | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/bin') diff --git a/src/bin/kittybox-check-webmention.rs b/src/bin/kittybox-check-webmention.rs index f02032c..820e7c4 100644 --- a/src/bin/kittybox-check-webmention.rs +++ b/src/bin/kittybox-check-webmention.rs @@ -104,7 +104,7 @@ fn check_mention(document: impl AsRef, base_url: &url::Url, link: &url::Url } } } - + } } @@ -128,7 +128,7 @@ struct Args { #[tokio::main] async fn main() -> Result<(), self::Error> { let args = Args::parse(); - + let http: reqwest::Client = { #[allow(unused_mut)] let mut builder = reqwest::Client::builder() @@ -141,7 +141,7 @@ async fn main() -> Result<(), self::Error> { let response = http.get(args.url.clone()).send().await?; let text = response.text().await?; - + if let Some(mention_type) = check_mention(text, &args.url, &args.link)? { println!("{:?}", mention_type); diff --git a/src/bin/kittybox-indieauth-helper.rs b/src/bin/kittybox-indieauth-helper.rs index 3377ec3..4e82f8b 100644 --- a/src/bin/kittybox-indieauth-helper.rs +++ b/src/bin/kittybox-indieauth-helper.rs @@ -80,7 +80,7 @@ async fn main() -> Result<(), Error> { let redirect_uri: url::Url = args.redirect_uri .clone() .unwrap_or_else(|| DEFAULT_REDIRECT_URI.parse().unwrap()); - + eprintln!("Checking .well-known for metadata..."); let metadata = http.get(args.me.join("/.well-known/oauth-authorization-server")?) .header("Accept", "application/json") @@ -90,7 +90,7 @@ async fn main() -> Result<(), Error> { .await?; let verifier = PKCEVerifier::new(); - + let authorization_request = AuthorizationRequest { response_type: kittybox_indieauth::ResponseType::Code, client_id: args.client_id.clone(), @@ -112,21 +112,21 @@ async fn main() -> Result<(), Error> { eprintln!("Custom redirect URI specified, won't be able to catch authorization response."); std::process::exit(0); } - + // Prepare a callback let (tx, rx) = tokio::sync::oneshot::channel::(); let server = { use axum::{routing::get, extract::Query, response::IntoResponse}; let tx = std::sync::Arc::new(tokio::sync::Mutex::new(Some(tx))); - + let router = axum::Router::new() .route("/callback", axum::routing::get( move |query: Option>| async move { if let Some(Query(response)) = query { if let Some(tx) = tx.lock_owned().await.take() { tx.send(response).unwrap(); - + (axum::http::StatusCode::OK, [("Content-Type", "text/plain")], "Thank you! This window can now be closed.") @@ -152,7 +152,7 @@ async fn main() -> Result<(), Error> { tokio::task::spawn(server) }; - + let authorization_response = rx.await.unwrap(); // Clean up after the server @@ -166,7 +166,7 @@ async fn main() -> Result<(), Error> { eprintln!("Got authorization response: {:#?}", authorization_response); eprint!("Checking issuer field..."); std::io::stderr().lock().flush()?; - + if dbg!(authorization_response.iss.as_str()) == dbg!(metadata.issuer.as_str()) { eprintln!(" Done"); } else { diff --git a/src/bin/kittybox-mf2.rs b/src/bin/kittybox-mf2.rs index 4366cb8..85ebc6f 100644 --- a/src/bin/kittybox-mf2.rs +++ b/src/bin/kittybox-mf2.rs @@ -27,7 +27,7 @@ enum Error { #[tokio::main] async fn main() -> Result<(), Error> { let args = Args::parse(); - + let http: reqwest::Client = { #[allow(unused_mut)] let mut builder = reqwest::Client::builder() -- cgit 1.4.1