diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 855b7e5b..be333e75 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: variables: GIT_CLEAN_FLAGS: -f - CACHE_IMAGE_TAG: d74ceb0a + CACHE_IMAGE_TAG: 23a6c908 default: # https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-pending-pipelines diff --git a/Cargo.lock b/Cargo.lock index cb8d3224..f536ebae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3468,9 +3468,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] diff --git a/client/src/gui/components/changelog_panel.rs b/client/src/gui/components/changelog_panel.rs index 391c7ff5..8029a825 100644 --- a/client/src/gui/components/changelog_panel.rs +++ b/client/src/gui/components/changelog_panel.rs @@ -143,8 +143,10 @@ impl ChangelogPanelComponent { // section done // save if not empty - if section_name.is_some() && !section_lines.is_empty() { - sections.push((section_name.unwrap(), section_lines)); + if let Some(section_name) = section_name + && !section_lines.is_empty() + { + sections.push((section_name, section_lines)); } }, // paragraph without section aka note diff --git a/client/src/gui/components/mod.rs b/client/src/gui/components/mod.rs index 3f653285..aede76dc 100644 --- a/client/src/gui/components/mod.rs +++ b/client/src/gui/components/mod.rs @@ -15,7 +15,5 @@ pub use community_showcase_panel::{ pub use game_panel::{GamePanelComponent, GamePanelMessage}; pub use logo_panel::LogoPanelComponent; pub use news_panel::{NewsPanelComponent, NewsPanelMessage}; -pub use server_browser_panel::{ - ServerBrowserEntry, ServerBrowserPanelComponent, ServerBrowserPanelMessage, -}; +pub use server_browser_panel::{ServerBrowserPanelComponent, ServerBrowserPanelMessage}; pub use settings_panel::{SettingsPanelComponent, SettingsPanelMessage}; diff --git a/client/src/gui/components/server_browser_panel.rs b/client/src/gui/components/server_browser_panel.rs index 1e124cb1..5280ab38 100644 --- a/client/src/gui/components/server_browser_panel.rs +++ b/client/src/gui/components/server_browser_panel.rs @@ -303,7 +303,9 @@ impl ServerBrowserPanelComponent { ) .padding(0); - let row_style = if let Some(selected_index) = self.selected_index && selected_index == i { + let row_style = if let Some(selected_index) = self.selected_index + && selected_index == i + { ButtonStyle::ServerListEntry(ServerListEntryButtonState::Selected) } else { ButtonStyle::ServerListEntry(ServerListEntryButtonState::NotSelected) diff --git a/client/src/gui/rss_feed.rs b/client/src/gui/rss_feed.rs index c0fb40ea..1b459a8d 100644 --- a/client/src/gui/rss_feed.rs +++ b/client/src/gui/rss_feed.rs @@ -89,7 +89,7 @@ pub trait RssFeedComponent { }, RssFeedComponentMessage::ImageFetched { result, url } => { if let Ok(bytes) = result { - if let Some(mut post) = self + if let Some(post) = self .posts_mut() .iter_mut() .filter(|post| post.image_url.is_some()) @@ -250,8 +250,11 @@ impl RssPost { .lines() .take(3) .filter(|x| !x.contains("[banner]")) - .map(|x| format!("{}\n", x)) - .collect::(); + .fold(String::new(), |mut output, b| { + use std::fmt::Write; + let _ = writeln!(output, "{b}"); + output + }); strip_markdown::strip_markdown(&stripped_html) }, None => "No description found.".into(), @@ -272,10 +275,12 @@ impl From<&rss::Item> for RssPost { // If the RSS item has an enclosure (attached media), check if it's a jpg or png // and if it is store the URL against the post for display in the RSS // feed. - if let Some(enclosure) = &item.enclosure && matches!(enclosure.mime_type.as_str(), "image/jpg" | "image/png") { + if let Some(enclosure) = &item.enclosure + && matches!(enclosure.mime_type.as_str(), "image/jpg" | "image/png") + { let mut url = enclosure.url.clone(); - // If the image is hosted by the discord CDN, use its ability to provide a + // If the image is hosted by the discord CDN, use its ability to provide a // resized image to save bandwidth if url.starts_with("https://media.discordapp.net") { url = format!("{}?width=320&height=240", url); diff --git a/client/src/io/fs.rs b/client/src/io/fs.rs index db3c4da9..d90b0f22 100644 --- a/client/src/io/fs.rs +++ b/client/src/io/fs.rs @@ -67,7 +67,7 @@ pub fn log_path_file() -> (&'static Path, &'static str) { pub fn unzip(profile: &Profile) -> Result<()> { tracing::info!("Unzipping to {:?}", profile.directory()); let mut zip_file = - std::fs::File::open(&profile.directory().join(consts::DOWNLOAD_FILE))?; + std::fs::File::open(profile.directory().join(consts::DOWNLOAD_FILE))?; let mut archive = zip::ZipArchive::new(&mut zip_file)?; diff --git a/rust-toolchain b/rust-toolchain index b27a258d..f1273305 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2023-04-20 +nightly-2024-01-17 diff --git a/server/src/fairings/mod.rs b/server/src/fairings/mod.rs index a906f6d2..dec10232 100644 --- a/server/src/fairings/mod.rs +++ b/server/src/fairings/mod.rs @@ -1,3 +1 @@ pub mod db; - -pub use db::*; diff --git a/server/src/routes/api.rs b/server/src/routes/api.rs index f0358cb2..7e9cd043 100644 --- a/server/src/routes/api.rs +++ b/server/src/routes/api.rs @@ -1,3 +1,4 @@ +#![allow(unused_imports)] use crate::{ config::{Platform, API_VERSION}, metrics::Metrics, diff --git a/server/src/routes/gitlab.rs b/server/src/routes/gitlab.rs index 9f40358e..a9de18e5 100644 --- a/server/src/routes/gitlab.rs +++ b/server/src/routes/gitlab.rs @@ -1,3 +1,4 @@ +#![allow(unused_imports)] use crate::{ guards::{GitlabEvent, GitlabSecret}, metrics::Metrics, diff --git a/server/src/routes/metrics.rs b/server/src/routes/metrics.rs index 43939cdd..55a4d649 100644 --- a/server/src/routes/metrics.rs +++ b/server/src/routes/metrics.rs @@ -1,3 +1,4 @@ +#![allow(unused_imports)] use crate::{metrics::Metrics, Result}; use rocket::*; use std::sync::Arc; diff --git a/server/src/routes/user.rs b/server/src/routes/user.rs index d543426d..75d321f3 100644 --- a/server/src/routes/user.rs +++ b/server/src/routes/user.rs @@ -1,3 +1,4 @@ +#![allow(unused_imports)] use rocket::*; #[get("/")]