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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user