clippy
This commit is contained in:
@@ -133,8 +133,9 @@ 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(_) => RequestHandler::handle_get_game_file_data(),
|
||||
Request::GetGameFileChunk { .. } => RequestHandler::handle_get_game_file_data(),
|
||||
Request::GetGameFileData(_) | Request::GetGameFileChunk { .. } => {
|
||||
RequestHandler::handle_get_game_file_data()
|
||||
}
|
||||
Request::Invalid(data, err_msg) => RequestHandler::handle_invalid(data, err_msg),
|
||||
}
|
||||
}
|
||||
@@ -166,7 +167,8 @@ async fn stream_file_bytes(
|
||||
let mut buf = vec![0u8; 64 * 1024];
|
||||
|
||||
while remaining > 0 {
|
||||
let read_len = std::cmp::min(remaining, buf.len() as u64) as usize;
|
||||
let read_len = std::cmp::min(remaining, buf.len() as u64);
|
||||
let read_len = usize::try_from(read_len).unwrap_or(buf.len());
|
||||
if read_len == 0 {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -330,9 +330,10 @@ fn update_game_directory(app_handle: tauri::AppHandle, path: String) {
|
||||
});
|
||||
|
||||
if let Some(peer_ctrl) = peer_ctrl
|
||||
&& let Err(e) = peer_ctrl.send(PeerCommand::SetGameDir(path.clone())) {
|
||||
log::error!("Failed to send PeerCommand::SetGameDir: {e}");
|
||||
}
|
||||
&& let Err(e) = peer_ctrl.send(PeerCommand::SetGameDir(path.clone()))
|
||||
{
|
||||
log::error!("Failed to send PeerCommand::SetGameDir: {e}");
|
||||
}
|
||||
|
||||
{
|
||||
tauri::async_runtime::block_on(async {
|
||||
|
||||
Reference in New Issue
Block a user