Cargo fmt

This commit is contained in:
Gabriel Simmer 2023-08-27 22:07:35 +01:00
parent 1916ea0efe
commit 00a5192d02
Signed by: arch
SSH key fingerprint: SHA256:m3OEcdtrnBpMX+2BDGh/byv3hrCekCLzDYMdvGEKPPQ
2 changed files with 20 additions and 17 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

View file

@ -1,9 +1,9 @@
use regex::Regex;
use reqwest::{Error as ReqwestError, StatusCode}; use reqwest::{Error as ReqwestError, StatusCode};
use rss::{Channel, Error as RssError}; use rss::{Channel, Error as RssError};
use regex::Regex;
use std::io::Cursor; use std::io::Cursor;
use worker::{Request, Env, Response, Router, event, Headers}; use worker::{event, Env, Headers, Request, Response, Router};
#[derive(Debug)] #[derive(Debug)]
enum CustomError { enum CustomError {
@ -38,7 +38,9 @@ pub async fn main(req: Request, env: Env, _ctx: worker::Context) -> worker::Resu
headers.set("content-type", "application/rss+xml"); headers.set("content-type", "application/rss+xml");
Ok(res.with_headers(headers)) Ok(res.with_headers(headers))
}).run(req, env).await })
.run(req, env)
.await
} }
async fn fetch_modified_rss() -> Result<String, CustomError> { async fn fetch_modified_rss() -> Result<String, CustomError> {
@ -53,7 +55,7 @@ async fn fetch_modified_rss() -> Result<String, CustomError> {
Err(RssError::InvalidStartTag) => { Err(RssError::InvalidStartTag) => {
eprintln!("Invalid start tag found in the feed. Please check the feed URL or try again later."); eprintln!("Invalid start tag found in the feed. Please check the feed URL or try again later.");
return Ok(String::new()); return Ok(String::new());
}, }
Err(err) => return Err(err.into()), Err(err) => return Err(err.into()),
}; };