From 6bfa3709d20d79601a948537f402de0b876f0502 Mon Sep 17 00:00:00 2001 From: ramiroaisen <52116153+ramiroaisen@users.noreply.github.com> Date: Sat, 25 Nov 2023 16:20:22 -0300 Subject: [PATCH] feat: update rust version --- rs/internal-scripts/hls-logger/src/main.rs | 2 +- rs/packages/api/src/routes/stations/id.rs | 4 ++-- .../api/src/routes/stations/reset_source_password.rs | 2 +- rs/packages/db/src/http/headers/mod.rs | 2 +- rs/packages/db/src/models/deployment/mod.rs | 2 +- rs/packages/db/src/models/station_picture/mod.rs | 4 ++-- rs/packages/db/src/models/stream_connection/lite/mod.rs | 2 +- rs/packages/db/src/models/stream_connection/mod.rs | 2 +- rs/packages/db/src/models/user_account_relation/mod.rs | 2 +- rs/packages/owo-colors/src/lib.rs | 8 ++++---- rs/packages/source-alt/src/handler/source.rs | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/rs/internal-scripts/hls-logger/src/main.rs b/rs/internal-scripts/hls-logger/src/main.rs index 053f0aab..e4bd9ecb 100644 --- a/rs/internal-scripts/hls-logger/src/main.rs +++ b/rs/internal-scripts/hls-logger/src/main.rs @@ -30,7 +30,7 @@ async fn logger(req: Request, next: Next) -> Response { .uri() .path_and_query() .map(ToString::to_string) - .unwrap_or_else(String::new); + .unwrap_or_default(); info!("{method} {uri}"); diff --git a/rs/packages/api/src/routes/stations/id.rs b/rs/packages/api/src/routes/stations/id.rs index ebfed458..0427289b 100644 --- a/rs/packages/api/src/routes/stations/id.rs +++ b/rs/packages/api/src/routes/stations/id.rs @@ -215,7 +215,7 @@ pub mod delete { ) .await; } else { - #[allow(clippy-clippy::collapsible_else_if)] + #[allow(clippy::collapsible_else_if)] if let Ok(Some(deployment)) = Deployment::get_by_id(&info.deployment_id).await { use rand::seq::SliceRandom; let addr = deployment.local_ip; @@ -411,7 +411,7 @@ pub mod patch { ) .await; } else { - #[allow(clippy-clippy::collapsible_else_if)] + #[allow(clippy::collapsible_else_if)] if let Ok(Some(deployment)) = Deployment::get_by_id(&info.deployment_id).await { use rand::seq::SliceRandom; let addr = deployment.local_ip; diff --git a/rs/packages/api/src/routes/stations/reset_source_password.rs b/rs/packages/api/src/routes/stations/reset_source_password.rs index 6a4a6609..4300f571 100644 --- a/rs/packages/api/src/routes/stations/reset_source_password.rs +++ b/rs/packages/api/src/routes/stations/reset_source_password.rs @@ -93,7 +93,7 @@ pub mod post { ) .await; } else { - #[allow(clippy-clippy::collapsible_else_if)] + #[allow(clippy::collapsible_else_if)] if let Ok(Some(deployment)) = Deployment::get_by_id(&info.deployment_id).await { use rand::seq::SliceRandom; let addr = deployment.local_ip; diff --git a/rs/packages/db/src/http/headers/mod.rs b/rs/packages/db/src/http/headers/mod.rs index 5dd8d0f0..527cbf71 100644 --- a/rs/packages/db/src/http/headers/mod.rs +++ b/rs/packages/db/src/http/headers/mod.rs @@ -11,7 +11,7 @@ use ts_rs::TS; pub struct Headers(IndexMap); impl Headers { - pub const REDACTED_VALUE: &str = "REDACTED"; + pub const REDACTED_VALUE: &'static str = "REDACTED"; #[inline] pub fn is_sensible_key(key: &str) -> bool { diff --git a/rs/packages/db/src/models/deployment/mod.rs b/rs/packages/db/src/models/deployment/mod.rs index 283e7187..36c4e440 100644 --- a/rs/packages/db/src/models/deployment/mod.rs +++ b/rs/packages/db/src/models/deployment/mod.rs @@ -62,7 +62,7 @@ pub enum DeploymentState { } impl Deployment { - pub const KEY_MANUALLY_CLOSED: &str = "_manually_closed"; + pub const KEY_MANUALLY_CLOSED: &'static str = "_manually_closed"; } impl Model for Deployment { diff --git a/rs/packages/db/src/models/station_picture/mod.rs b/rs/packages/db/src/models/station_picture/mod.rs index 9b8feea3..4c44a82f 100644 --- a/rs/packages/db/src/models/station_picture/mod.rs +++ b/rs/packages/db/src/models/station_picture/mod.rs @@ -223,8 +223,8 @@ pub async fn upgrade_images_if_needed() -> Result<(), CreateStationPictureError> impl StationPicture { pub const VERSION: f64 = constants::STATION_PICTURES_VERSION; - pub const PNG_SIZES: &[f64] = &[32.0, 64.0, 128.0, 192.0, 256.0, 512.0]; - pub const WEBP_SIZES: &[f64] = &[32.0, 64.0, 128.0, 256.0, 384.0, 512.0]; + pub const PNG_SIZES: &'static [f64] = &[32.0, 64.0, 128.0, 192.0, 256.0, 512.0]; + pub const WEBP_SIZES: &'static [f64] = &[32.0, 64.0, 128.0, 256.0, 384.0, 512.0]; pub async fn delete_with_session( id: &str, diff --git a/rs/packages/db/src/models/stream_connection/lite/mod.rs b/rs/packages/db/src/models/stream_connection/lite/mod.rs index 646d0da3..9ce27677 100644 --- a/rs/packages/db/src/models/stream_connection/lite/mod.rs +++ b/rs/packages/db/src/models/stream_connection/lite/mod.rs @@ -56,7 +56,7 @@ pub struct StreamConnectionLite { } impl StreamConnectionLite { - pub const KET_MANUALLY_CLOSED: &str = "_m"; + pub const KET_MANUALLY_CLOSED: &'static str = "_m"; pub fn get_domain(full: &StreamConnection) -> Option { match full.request.headers.get("referer") { diff --git a/rs/packages/db/src/models/stream_connection/mod.rs b/rs/packages/db/src/models/stream_connection/mod.rs index 9a9129ec..a5c0dc2b 100644 --- a/rs/packages/db/src/models/stream_connection/mod.rs +++ b/rs/packages/db/src/models/stream_connection/mod.rs @@ -39,7 +39,7 @@ pub struct StreamConnection { } impl StreamConnection { - pub const KEY_MANUALLY_CLOSED: &str = "_manually_closed"; + pub const KEY_MANUALLY_CLOSED: &'static str = "_manually_closed"; } impl Model for StreamConnection { diff --git a/rs/packages/db/src/models/user_account_relation/mod.rs b/rs/packages/db/src/models/user_account_relation/mod.rs index 5393dde1..6e61d4ab 100644 --- a/rs/packages/db/src/models/user_account_relation/mod.rs +++ b/rs/packages/db/src/models/user_account_relation/mod.rs @@ -30,7 +30,7 @@ pub enum UserAccountRelationKind { } impl UserAccountRelationKind { - pub const TAG_OWNER: &str = "owner"; + pub const TAG_OWNER: &'static str = "owner"; } impl Model for UserAccountRelation { diff --git a/rs/packages/owo-colors/src/lib.rs b/rs/packages/owo-colors/src/lib.rs index 08c7a3b6..49df34fe 100644 --- a/rs/packages/owo-colors/src/lib.rs +++ b/rs/packages/owo-colors/src/lib.rs @@ -11,12 +11,12 @@ //! ```rust //! use owo_colors::OwoColorize; //! -//! fn main() { +//! # fn main() { //! // Foreground colors //! println!("My number is {:#x}!", 10.green()); //! // Background colors //! println!("My number is not {}!", 4.on_red()); -//! } +//! # } //! ``` //! //! ## Generically color @@ -25,10 +25,10 @@ //! use owo_colors::OwoColorize; //! use owo_colors::colors::*; //! -//! fn main() { +//! # fn main() { //! // Generically color //! println!("My number might be {}!", 4.fg::().bg::()); -//! } +//! # } //! ``` //! //! ## Stylize diff --git a/rs/packages/source-alt/src/handler/source.rs b/rs/packages/source-alt/src/handler/source.rs index 85f12c83..e6129065 100644 --- a/rs/packages/source-alt/src/handler/source.rs +++ b/rs/packages/source-alt/src/handler/source.rs @@ -303,7 +303,7 @@ pub async fn source( .get("user-agent") .and_then(|h| h.to_str().ok()) .map(user_agent::UserAgent::parse) - .unwrap_or_else(user_agent::UserAgent::default); + .unwrap_or_default(); let request_document = db::http::Request { real_ip,