fix: replace 2 instances of .get(0) with .first()

This commit is contained in:
CosminPerRam 2024-02-25 23:54:19 +02:00
parent 4d214ad5fb
commit 1080a94bd2
2 changed files with 2 additions and 2 deletions

View file

@ -354,7 +354,7 @@ pub fn query(address: &SocketAddr, timeout_settings: Option<TimeoutSettings>) ->
let mut client = GameSpy3::new(address, timeout_settings)?;
let packets = client.get_server_packets()?;
let (mut server_vars, remaining_data) = data_to_map(packets.get(0).ok_or(GDErrorKind::PacketBad)?)?;
let (mut server_vars, remaining_data) = data_to_map(packets.first().ok_or(GDErrorKind::PacketBad)?)?;
let mut remaining_data_packets = vec![remaining_data];
remaining_data_packets.extend_from_slice(&packets[1 ..]);