fix(clippy): add lifetime annotations to various methods and structs (mismatched_lifetime_syntaxes)

This commit is contained in:
Cain 2026-02-22 17:47:05 +00:00
parent a5f15a040a
commit 4ea333f16b
17 changed files with 33 additions and 33 deletions

View file

@ -98,7 +98,7 @@ pub struct Player {
}
impl CommonPlayer for Player {
fn as_original(&self) -> crate::protocols::types::GenericPlayer {
fn as_original(&self) -> crate::protocols::types::GenericPlayer<'_> {
crate::protocols::types::GenericPlayer::Eco(self)
}
@ -201,7 +201,7 @@ impl From<Root> for Response {
}
impl CommonResponse for Response {
fn as_original(&self) -> crate::protocols::GenericResponse { crate::protocols::GenericResponse::Eco(self) }
fn as_original(&self) -> crate::protocols::GenericResponse<'_> { crate::protocols::GenericResponse::Eco(self) }
fn players_online(&self) -> u32 { self.players_online }

View file

@ -43,7 +43,7 @@ pub struct Response {
}
impl CommonResponse for Response {
fn as_original(&self) -> GenericResponse { GenericResponse::FFOW(self) }
fn as_original(&self) -> GenericResponse<'_> { GenericResponse::FFOW(self) }
fn name(&self) -> Option<&str> { Some(&self.name) }
fn game_mode(&self) -> Option<&str> { Some(&self.game_mode) }

View file

@ -12,7 +12,7 @@ pub struct Player {
}
impl CommonPlayer for Player {
fn as_original(&self) -> GenericPlayer { GenericPlayer::JCMP2(self) }
fn as_original(&self) -> GenericPlayer<'_> { GenericPlayer::JCMP2(self) }
fn name(&self) -> &str { &self.name }
}
@ -30,7 +30,7 @@ pub struct Response {
}
impl CommonResponse for Response {
fn as_original(&self) -> GenericResponse { GenericResponse::JC2M(self) }
fn as_original(&self) -> GenericResponse<'_> { GenericResponse::JC2M(self) }
fn game_version(&self) -> Option<&str> { Some(&self.game_version) }
fn description(&self) -> Option<&str> { Some(&self.description) }

View file

@ -64,7 +64,7 @@ impl GameMode {
}
impl CommonResponse for ServerData {
fn as_original(&self) -> GenericResponse { GenericResponse::Mindustry(self) }
fn as_original(&self) -> GenericResponse<'_> { GenericResponse::Mindustry(self) }
fn players_online(&self) -> u32 { self.players.try_into().unwrap_or(0) }
fn players_maximum(&self) -> u32 { self.player_limit.try_into().unwrap_or(0) }

View file

@ -49,7 +49,7 @@ pub struct Player {
}
impl CommonPlayer for Player {
fn as_original(&self) -> GenericPlayer { GenericPlayer::Minecraft(self) }
fn as_original(&self) -> GenericPlayer<'_> { GenericPlayer::Minecraft(self) }
fn name(&self) -> &str { &self.name }
}
@ -134,7 +134,7 @@ impl From<ExtraRequestSettings> for RequestSettings {
}
impl CommonResponse for JavaResponse {
fn as_original(&self) -> GenericResponse { GenericResponse::Minecraft(VersionedResponse::Java(self)) }
fn as_original(&self) -> GenericResponse<'_> { GenericResponse::Minecraft(VersionedResponse::Java(self)) }
fn description(&self) -> Option<&str> { Some(&self.description) }
fn players_maximum(&self) -> u32 { self.players_maximum }
@ -175,7 +175,7 @@ pub struct BedrockResponse {
}
impl CommonResponse for BedrockResponse {
fn as_original(&self) -> GenericResponse { GenericResponse::Minecraft(VersionedResponse::Bedrock(self)) }
fn as_original(&self) -> GenericResponse<'_> { GenericResponse::Minecraft(VersionedResponse::Bedrock(self)) }
fn name(&self) -> Option<&str> { Some(&self.name) }
fn map(&self) -> Option<&str> { self.map.as_deref() }

View file

@ -20,7 +20,7 @@ pub struct Response {
}
impl CommonResponse for Response {
fn as_original(&self) -> GenericResponse { GenericResponse::Savage2(self) }
fn as_original(&self) -> GenericResponse<'_> { GenericResponse::Savage2(self) }
fn name(&self) -> Option<&str> { Some(&self.name) }
fn game_mode(&self) -> Option<&str> { Some(&self.game_mode) }

View file

@ -31,7 +31,7 @@ impl TheShipPlayer {
}
impl CommonPlayer for TheShipPlayer {
fn as_original(&self) -> GenericPlayer { GenericPlayer::TheShip(self) }
fn as_original(&self) -> GenericPlayer<'_> { GenericPlayer::TheShip(self) }
fn name(&self) -> &str { &self.name }
fn score(&self) -> Option<i32> { Some(self.score) }
@ -64,7 +64,7 @@ pub struct Response {
}
impl CommonResponse for Response {
fn as_original(&self) -> GenericResponse { GenericResponse::TheShip(self) }
fn as_original(&self) -> GenericResponse<'_> { GenericResponse::TheShip(self) }
fn name(&self) -> Option<&str> { Some(&self.name) }
fn map(&self) -> Option<&str> { Some(&self.map) }