mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
fix(clippy): add lifetime annotations to various methods and structs (mismatched_lifetime_syntaxes)
This commit is contained in:
parent
a5f15a040a
commit
4ea333f16b
17 changed files with 33 additions and 33 deletions
|
|
@ -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 }
|
||||
|
||||
|
|
|
|||
|
|
@ -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) }
|
||||
|
|
|
|||
|
|
@ -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) }
|
||||
|
|
|
|||
|
|
@ -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) }
|
||||
|
|
|
|||
|
|
@ -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() }
|
||||
|
|
|
|||
|
|
@ -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) }
|
||||
|
|
|
|||
|
|
@ -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) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue