Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update rust version #220

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rs/internal-scripts/hls-logger/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");

Expand Down
4 changes: 2 additions & 2 deletions rs/packages/api/src/routes/stations/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion rs/packages/db/src/http/headers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use ts_rs::TS;
pub struct Headers(IndexMap<String, String>);

impl Headers {
pub const REDACTED_VALUE: &str = "REDACTED";
pub const REDACTED_VALUE: &'static str = "REDACTED";

#[inline]
pub fn is_sensible_key(key: &str) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion rs/packages/db/src/models/deployment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions rs/packages/db/src/models/station_picture/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion rs/packages/db/src/models/stream_connection/lite/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
match full.request.headers.get("referer") {
Expand Down
2 changes: 1 addition & 1 deletion rs/packages/db/src/models/stream_connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion rs/packages/db/src/models/user_account_relation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions rs/packages/owo-colors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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::<Black>().bg::<Yellow>());
//! }
//! # }
//! ```
//!
//! ## Stylize
Expand Down
2 changes: 1 addition & 1 deletion rs/packages/source-alt/src/handler/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading