Skip to content

Commit 6e7c743

Browse files
committed
fix some imports
1 parent 62e3069 commit 6e7c743

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

azalea-chat/src/component.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@ use std::{
55
sync::LazyLock,
66
};
77

8-
#[cfg(feature = "azalea-buf")]
8+
#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))]
99
use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError};
1010
use serde::{Deserialize, Deserializer, Serialize, de};
11-
#[cfg(feature = "simdnbt")]
12-
use simdnbt::{Deserialize as _, FromNbtTag as _, Serialize as _};
13-
#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))]
14-
use tracing::{debug, trace, warn};
1511

1612
use crate::{
1713
base_component::BaseComponent,
@@ -66,6 +62,8 @@ impl FormattedText {
6662

6763
#[cfg(feature = "simdnbt")]
6864
fn parse_separator_nbt(nbt: &simdnbt::borrow::NbtCompound) -> Option<FormattedText> {
65+
use simdnbt::FromNbtTag;
66+
6967
if let Some(separator) = nbt.get("separator") {
7068
FormattedText::from_nbt_tag(separator)
7169
} else {
@@ -447,6 +445,8 @@ impl FormattedText {
447445
FormattedText::from(s)
448446
}
449447
fn from_nbt_list(list: simdnbt::borrow::NbtList) -> Option<FormattedText> {
448+
use tracing::debug;
449+
450450
let mut component;
451451
if let Some(compounds) = list.compounds() {
452452
component = FormattedText::from_nbt_compound(compounds.first()?)?;
@@ -466,6 +466,9 @@ impl FormattedText {
466466
}
467467

468468
pub fn from_nbt_compound(compound: simdnbt::borrow::NbtCompound) -> Option<Self> {
469+
use simdnbt::{Deserialize, FromNbtTag};
470+
use tracing::{trace, warn};
471+
469472
let mut component: FormattedText;
470473

471474
if let Some(text) = compound.get("text") {
@@ -617,6 +620,9 @@ impl From<&simdnbt::Mutf8Str> for FormattedText {
617620
#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))]
618621
impl AzaleaRead for FormattedText {
619622
fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
623+
use simdnbt::FromNbtTag;
624+
use tracing::trace;
625+
620626
let nbt = simdnbt::borrow::read_optional_tag(buf)?;
621627
trace!(
622628
"Reading NBT for FormattedText: {:?}",
@@ -634,6 +640,8 @@ impl AzaleaRead for FormattedText {
634640
#[cfg(all(feature = "azalea-buf", feature = "simdnbt"))]
635641
impl AzaleaWrite for FormattedText {
636642
fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
643+
use simdnbt::Serialize;
644+
637645
let mut out = Vec::new();
638646
simdnbt::owned::BaseNbt::write_unnamed(&(self.clone().to_compound().into()), &mut out);
639647
buf.write_all(&out)

azalea-core/src/registry_holder/dimension_type.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#[cfg(not(feature = "strict_registry"))]
21
use std::collections::HashMap;
32

4-
#[cfg(not(feature = "strict_registry"))]
5-
use simdnbt::{Deserialize, Serialize, owned::NbtTag};
6-
use simdnbt::{FromNbtTag, ToNbtTag, owned::NbtCompound};
3+
use simdnbt::{
4+
Deserialize, FromNbtTag, Serialize, ToNbtTag,
5+
owned::{NbtCompound, NbtTag},
6+
};
77

88
use crate::identifier::Identifier;
99

0 commit comments

Comments
 (0)