[clippy] fixes
This commit is contained in:
@@ -61,7 +61,7 @@ impl Eq for Game {}
|
|||||||
|
|
||||||
impl PartialOrd for Game {
|
impl PartialOrd for Game {
|
||||||
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
|
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
|
||||||
Some(self.name.cmp(&other.name))
|
Some(self.cmp(other))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -59,8 +59,9 @@ pub fn discover_service(
|
|||||||
ServiceEvent::ServiceResolved(info) => {
|
ServiceEvent::ServiceResolved(info) => {
|
||||||
tracing::trace!(?info, "mdns ServiceResolved event");
|
tracing::trace!(?info, "mdns ServiceResolved event");
|
||||||
|
|
||||||
if let Some(instance_name) = instance_name {
|
if let Some(instance_name) = instance_name
|
||||||
if info.get_fullname() != format!("{instance_name}.{service_type}") {
|
&& info.get_fullname() != format!("{instance_name}.{service_type}")
|
||||||
|
{
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
"Found service with wrong instance name: {} (expected: {})",
|
"Found service with wrong instance name: {} (expected: {})",
|
||||||
info.get_fullname(),
|
info.get_fullname(),
|
||||||
@@ -68,7 +69,6 @@ pub fn discover_service(
|
|||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(address) = info.get_addresses().iter().next() {
|
if let Some(address) = info.get_addresses().iter().next() {
|
||||||
tracing::info!("Found server at {}:{}", address, info.get_port());
|
tracing::info!("Found server at {}:{}", address, info.get_port());
|
||||||
|
@@ -100,11 +100,11 @@ impl RequestHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_get_game_file_data(&self) -> Response {
|
fn handle_get_game_file_data() -> Response {
|
||||||
Response::InvalidRequest(Bytes::new(), "Not implemented".to_string())
|
Response::InvalidRequest(Bytes::new(), "Not implemented".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_invalid(&self, data: Bytes, err_msg: String) -> Response {
|
fn handle_invalid(data: Bytes, err_msg: String) -> Response {
|
||||||
Response::InvalidRequest(data, err_msg)
|
Response::InvalidRequest(data, err_msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,8 +113,8 @@ impl RequestHandler {
|
|||||||
Request::Ping => RequestHandler::handle_ping(),
|
Request::Ping => RequestHandler::handle_ping(),
|
||||||
Request::ListGames => self.handle_list_games().await,
|
Request::ListGames => self.handle_list_games().await,
|
||||||
Request::GetGame { id } => self.handle_get_game(id, games_folder).await,
|
Request::GetGame { id } => self.handle_get_game(id, games_folder).await,
|
||||||
Request::GetGameFileData(_) => self.handle_get_game_file_data(),
|
Request::GetGameFileData(_) => RequestHandler::handle_get_game_file_data(),
|
||||||
Request::Invalid(data, err_msg) => self.handle_invalid(data, err_msg),
|
Request::Invalid(data, err_msg) => RequestHandler::handle_invalid(data, err_msg),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user