mirror of
https://github.com/Tribufu/rust-gamedig
synced 2026-08-11 16:11:05 +00:00
chore: use Self where possible
This commit is contained in:
parent
f431508418
commit
486abbd9f7
3 changed files with 10 additions and 10 deletions
|
|
@ -50,7 +50,7 @@ pub struct ServerInfo {
|
|||
|
||||
impl ServerInfo {
|
||||
pub fn parse<B: ByteOrder>(buffer: &mut Buffer<B>) -> GDResult<Self> {
|
||||
Ok(ServerInfo {
|
||||
Ok(Self {
|
||||
server_id: buffer.read()?,
|
||||
ip: buffer.read_string::<Unreal2StringDecoder>(None)?,
|
||||
game_port: buffer.read()?,
|
||||
|
|
@ -118,7 +118,7 @@ impl Players {
|
|||
/// Pre-allocate the vectors inside the players struct based on the provided
|
||||
/// capacity.
|
||||
pub fn with_capacity(capacity: usize) -> Self {
|
||||
Players {
|
||||
Self {
|
||||
players: Vec::with_capacity(capacity),
|
||||
// Allocate half as many bots as we don't expect there to be as many
|
||||
bots: Vec::with_capacity(capacity / 2),
|
||||
|
|
@ -234,7 +234,7 @@ impl GatheringSettings {
|
|||
}
|
||||
|
||||
impl Default for GatheringSettings {
|
||||
fn default() -> Self { GatheringSettings::default() }
|
||||
fn default() -> Self { Self::default() }
|
||||
}
|
||||
|
||||
impl From<ExtraRequestSettings> for GatheringSettings {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue