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