Upgrade all dependencies
Some checks failed
CI / CI (push) Has been cancelled

Also 'cargo clippy --fix', as current clippy warns on more things.
This commit is contained in:
2024-11-05 23:43:33 -08:00
parent 0df350dae6
commit 0f8f580050
8 changed files with 2579 additions and 792 deletions

View File

@@ -112,14 +112,14 @@ async fn handle_list(
let rooms_f = room_ids.iter().map(|room_id| {
matrix::ensure_room_joined(matrix_client, room_id)
.map(move |res| res.with_context(|| format!("Failed to join Matrix room '{}'", room_id)))
.map(move |res| res.with_context(|| format!("Failed to join Matrix room '{room_id}'")))
});
let rooms = join_all(rooms_f)
.await
.into_iter()
.flat_map(|room_res| match room_res {
Err(err) => {
warn!("{:#}", err);
warn!("{err:#}");
vec![]
}
Ok(room) => vec![room],
@@ -133,7 +133,7 @@ async fn handle_list(
.get(url)
.send()
.await
.with_context(|| format!("Failed to fetch mail RSS feed from '{}'", url))
.with_context(|| format!("Failed to fetch mail RSS feed from '{url}'"))
.and_then(|response| {
if !response.status().is_success() {
Err(anyhow!(
@@ -148,10 +148,10 @@ async fn handle_list(
let body = response
.text()
.await
.with_context(|| format!("Failed to decode RSS response body for '{}'", url))?;
.with_context(|| format!("Failed to decode RSS response body for '{url}'"))?;
let mail_rss = tokio::task::spawn_blocking(move || quick_xml::de::from_str::<MailRss>(&body))
.await?
.with_context(|| format!("Failed to parse RSS feed for '{}'", url))?;
.with_context(|| format!("Failed to parse RSS feed for '{url}'"))?;
let items = mail_rss
.channel
.items
@@ -167,7 +167,7 @@ async fn handle_list(
"\\[{}\\] [{}]({})",
list.name, item.title, item.link
));
room.send(msg, None)
room.send(msg)
.await
.with_context(|| format!("Failed to send message to room '{}'", room.room_id()))?;
}
@@ -223,7 +223,7 @@ pub fn start_polling(config: MailArchiveConfig, matrix_client: Client) -> anyhow
)
.await
{
warn!("{:#}", err);
warn!("{err:#}");
}
sleep(update_interval).await;
@@ -269,7 +269,7 @@ mod test {
let f = File::open(format!("{}/test-data/maillist.xml", env!("CARGO_MANIFEST_DIR")))?;
let r = BufReader::new(f);
let mail_rss = quick_xml::de::from_reader::<_, MailRss>(r)?;
println!("{:#?}", mail_rss);
println!("{mail_rss:#?}");
Ok(())
}
}