Placate clippy

This commit is contained in:
SkyfallWasTaken 2024-07-02 17:55:45 +01:00
parent 2bacb34e84
commit 4c34f69a79
2 changed files with 5 additions and 5 deletions

View file

@ -61,6 +61,7 @@ pub fn format_new_item(item: &ShopItem) -> String {
#[cfg(test)]
mod format_new_tests {
use super::*;
use indoc::indoc;
#[test]
fn item_formatted() {

View file

@ -23,10 +23,9 @@ pub async fn main(req: Request, env: Env, _ctx: worker::Context) -> Result<Respo
#[event(scheduled)]
pub async fn scheduled(_event: ScheduledEvent, env: Env, _ctx: ScheduleContext) {
run_scrape(env).await.expect(&format!(
"failed to run scheduled scrape: {}",
_event.schedule()
));
run_scrape(env)
.await
.unwrap_or_else(|_| panic!("failed to run scheduled scrape: {}", _event.schedule()));
}
async fn run_scrape(env: Env) -> Result<String> {
@ -54,7 +53,7 @@ async fn run_scrape(env: Env) -> Result<String> {
}
}
None => {
result.push(format::format_new_item(&item));
result.push(format::format_new_item(item));
}
}
}