1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

fix unused import warnings when compiling some crates individually

This commit is contained in:
mat 2025-06-16 05:50:06 +05:00
parent 318d95491c
commit 8f70f191bb
3 changed files with 8 additions and 9 deletions

View file

@ -3,12 +3,11 @@ mod suggestions;
mod suggestions_builder; mod suggestions_builder;
#[cfg(feature = "azalea-buf")] #[cfg(feature = "azalea-buf")]
use std::io::Write; use std::io::{self, Write};
use std::{ use std::{
cmp::Ordering, cmp::Ordering,
fmt::{self, Display}, fmt::{self, Display},
hash::Hash, hash::Hash,
io,
}; };
#[cfg(feature = "azalea-buf")] #[cfg(feature = "azalea-buf")]

View file

@ -1,6 +1,6 @@
#[cfg(feature = "azalea-buf")] #[cfg(feature = "azalea-buf")]
use std::io::{Cursor, Write}; use std::io::{self, Cursor, Write};
use std::{collections::HashSet, hash::Hash, io}; use std::{collections::HashSet, hash::Hash};
#[cfg(feature = "azalea-buf")] #[cfg(feature = "azalea-buf")]
use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError};

View file

@ -1,6 +1,7 @@
#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))]
use std::io::{self, Cursor, Write};
use std::{ use std::{
fmt::{self, Display}, fmt::{self, Display},
io::{self, Cursor, Write},
sync::LazyLock, sync::LazyLock,
}; };
@ -9,6 +10,7 @@ use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError};
use serde::{Deserialize, Deserializer, Serialize, de}; use serde::{Deserialize, Deserializer, Serialize, de};
#[cfg(feature = "simdnbt")] #[cfg(feature = "simdnbt")]
use simdnbt::{Deserialize as _, FromNbtTag as _, Serialize as _}; use simdnbt::{Deserialize as _, FromNbtTag as _, Serialize as _};
#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))]
use tracing::{debug, trace, warn}; use tracing::{debug, trace, warn};
use crate::{ use crate::{
@ -546,8 +548,7 @@ impl From<&simdnbt::Mutf8Str> for FormattedText {
} }
} }
#[cfg(feature = "azalea-buf")] #[cfg(all(feature = "azalea-buf", feature = "simdnbt"))]
#[cfg(feature = "simdnbt")]
impl AzaleaRead for FormattedText { impl AzaleaRead for FormattedText {
fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
let nbt = simdnbt::borrow::read_optional_tag(buf)?; let nbt = simdnbt::borrow::read_optional_tag(buf)?;
@ -560,8 +561,7 @@ impl AzaleaRead for FormattedText {
} }
} }
#[cfg(feature = "azalea-buf")] #[cfg(all(feature = "azalea-buf", feature = "simdnbt"))]
#[cfg(feature = "simdnbt")]
impl AzaleaWrite for FormattedText { impl AzaleaWrite for FormattedText {
fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
let mut out = Vec::new(); let mut out = Vec::new();