From 831a53e3b4f61a5b42c4a4b06d6351d62bce778e Mon Sep 17 00:00:00 2001 From: Garen Tyler Date: Tue, 3 Dec 2024 20:40:07 -0700 Subject: [PATCH] Minor warning fixes --- Cargo.toml | 2 +- LICENSE | 2 +- crates/composition-core/src/config.rs | 4 ++-- crates/composition-protocol/src/packets/mod.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b3d056f..a97d017 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Garen Tyler "] repository = "https://github.com/garentyler/composition" readme = "README.md" license = "MIT" -edition = "2021" +edition = "2024" [workspace.dependencies] anyhow = "1.0.71" diff --git a/LICENSE b/LICENSE index 0a479b7..8e9195c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020-2023 Garen Tyler +Copyright (c) 2020-2024 Garen Tyler Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/crates/composition-core/src/config.rs b/crates/composition-core/src/config.rs index 41a4b2c..213330b 100644 --- a/crates/composition-core/src/config.rs +++ b/crates/composition-core/src/config.rs @@ -122,7 +122,7 @@ impl Config { #[tracing::instrument] fn write(&self, path: &Path) { trace!("Config.write()"); - if let Ok(mut file) = File::options().write(true).create(true).open(path) { + if let Ok(mut file) = File::options().write(true).create(true).truncate(true).open(path) { if file .write_all(toml::to_string(&self).unwrap().as_bytes()) .is_ok() @@ -136,7 +136,7 @@ impl Config { #[tracing::instrument] fn write_server_icon(&self, path: &Path) { trace!("Config.write_server_icon()"); - if let Ok(mut file) = File::options().write(true).create(true).open(path) { + if let Ok(mut file) = File::options().write(true).create(true).truncate(true).open(path) { if file.write_all(&self.server_icon_bytes).is_ok() { return; } diff --git a/crates/composition-protocol/src/packets/mod.rs b/crates/composition-protocol/src/packets/mod.rs index 3221d1e..ef7581c 100644 --- a/crates/composition-protocol/src/packets/mod.rs +++ b/crates/composition-protocol/src/packets/mod.rs @@ -147,7 +147,7 @@ macro_rules! packet { } impl composition_parsing::parsable::Parsable for $packet_type { #[tracing::instrument] - fn parse<'data>(data: &'data [u8]) -> composition_parsing::ParseResult<'_, Self> { + fn parse<'data>(data: &'data [u8]) -> composition_parsing::ParseResult<'data, Self> { $parse_body(data) } #[tracing::instrument]