diff --git a/azalea-brigadier/src/suggestion/mod.rs b/azalea-brigadier/src/suggestion/mod.rs index af29264e..8a43489a 100644 --- a/azalea-brigadier/src/suggestion/mod.rs +++ b/azalea-brigadier/src/suggestion/mod.rs @@ -3,12 +3,11 @@ mod suggestions; mod suggestions_builder; #[cfg(feature = "azalea-buf")] -use std::io::Write; +use std::io::{self, Write}; use std::{ cmp::Ordering, fmt::{self, Display}, hash::Hash, - io, }; #[cfg(feature = "azalea-buf")] diff --git a/azalea-brigadier/src/suggestion/suggestions.rs b/azalea-brigadier/src/suggestion/suggestions.rs index 7f04d9d7..cc77365c 100644 --- a/azalea-brigadier/src/suggestion/suggestions.rs +++ b/azalea-brigadier/src/suggestion/suggestions.rs @@ -1,6 +1,6 @@ #[cfg(feature = "azalea-buf")] -use std::io::{Cursor, Write}; -use std::{collections::HashSet, hash::Hash, io}; +use std::io::{self, Cursor, Write}; +use std::{collections::HashSet, hash::Hash}; #[cfg(feature = "azalea-buf")] use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index c04aac4e..817d00b3 100644 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -1,6 +1,7 @@ +#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))] +use std::io::{self, Cursor, Write}; use std::{ fmt::{self, Display}, - io::{self, Cursor, Write}, sync::LazyLock, }; @@ -9,6 +10,7 @@ use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError}; use serde::{Deserialize, Deserializer, Serialize, de}; #[cfg(feature = "simdnbt")] use simdnbt::{Deserialize as _, FromNbtTag as _, Serialize as _}; +#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))] use tracing::{debug, trace, warn}; use crate::{ @@ -546,8 +548,7 @@ impl From<&simdnbt::Mutf8Str> for FormattedText { } } -#[cfg(feature = "azalea-buf")] -#[cfg(feature = "simdnbt")] +#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))] impl AzaleaRead for FormattedText { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result { let nbt = simdnbt::borrow::read_optional_tag(buf)?; @@ -560,8 +561,7 @@ impl AzaleaRead for FormattedText { } } -#[cfg(feature = "azalea-buf")] -#[cfg(feature = "simdnbt")] +#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))] impl AzaleaWrite for FormattedText { fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { let mut out = Vec::new();