From fa24625a1f75c168bcb107ecab1fd14f27ddfcce Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Sat, 20 May 2023 21:17:01 +0200 Subject: [PATCH] chore: conform linting --- src/commands/bib.rs | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/commands/bib.rs b/src/commands/bib.rs index 01e7dab..9f28cee 100644 --- a/src/commands/bib.rs +++ b/src/commands/bib.rs @@ -50,25 +50,20 @@ pub async fn available(ctx: Context<'_>, date: HumanNaiveDate) -> Result<(), Err let client = &ctx.data().client; let date: NaiveDate = date.into(); - let mut resources = client - .available(STERRE_BIB_ID, date, 1) - .await?; + let mut resources = client.available(STERRE_BIB_ID, date, 1).await?; // Cloning here isn't super efficient, but this list only consists of a handful of elements so // it's fine resources.sort_by_key(|k| k.resource_name.clone()); ctx.send(|f| { f.embed(|e| { - e.description(format!( - "Available booking dates for {}.", - date - )) - .fields( - resources - .into_iter() - .map(resource_to_embed_field) - .collect::>(), - ) + e.description(format!("Available booking dates for {}.", date)) + .fields( + resources + .into_iter() + .map(resource_to_embed_field) + .collect::>(), + ) }) }) .await?; @@ -110,9 +105,7 @@ pub async fn book( let user = user.unwrap(); let client = &ctx.data().client; - let resources = client - .available(STERRE_BIB_ID, date, 1) - .await?; + let resources = client.available(STERRE_BIB_ID, date, 1).await?; let chosen_resource = resources .iter() .filter(|r| capacity.is_none() || capacity.unwrap() <= r.capacity)