diff options
| author | mat <git@matdoes.dev> | 2024-10-26 05:29:26 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-10-26 05:29:26 +0000 |
| commit | 6b0fe5bf638079d535e70c3c91e78fe35a5d2a2f (patch) | |
| tree | 3b65d2984a0cffbe5acb3d44d7e3b8b145c32f95 /azalea-chat | |
| parent | b762575db61cf775d603e11eb2bd27ae13bdc4e9 (diff) | |
| download | azalea-drasl-6b0fe5bf638079d535e70c3c91e78fe35a5d2a2f.tar.xz | |
group imports with rustfmt
Diffstat (limited to 'azalea-chat')
| -rwxr-xr-x | azalea-chat/src/base_component.rs | 3 | ||||
| -rwxr-xr-x | azalea-chat/src/component.rs | 16 | ||||
| -rwxr-xr-x | azalea-chat/src/style.rs | 3 | ||||
| -rwxr-xr-x | azalea-chat/src/text_component.rs | 9 | ||||
| -rwxr-xr-x | azalea-chat/src/translatable_component.rs | 7 |
5 files changed, 21 insertions, 17 deletions
diff --git a/azalea-chat/src/base_component.rs b/azalea-chat/src/base_component.rs index 8f70ecb7..b01f2eb3 100755 --- a/azalea-chat/src/base_component.rs +++ b/azalea-chat/src/base_component.rs @@ -1,6 +1,7 @@ -use crate::{style::Style, FormattedText}; use serde::Serialize; +use crate::{style::Style, FormattedText}; + #[derive(Clone, Debug, PartialEq, Serialize, Eq, Hash)] pub struct BaseComponent { // implements mutablecomponent diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index dff4d91d..84b5ed17 100755 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -1,18 +1,20 @@ -use crate::{ - base_component::BaseComponent, - style::{ChatFormatting, Style}, - text_component::TextComponent, - translatable_component::{StringOrComponent, TranslatableComponent}, -}; +use std::fmt::Display; + #[cfg(feature = "azalea-buf")] use azalea_buf::{BufReadError, McBufReadable, McBufWritable}; use once_cell::sync::Lazy; use serde::{de, Deserialize, Deserializer, Serialize}; #[cfg(feature = "simdnbt")] use simdnbt::{Deserialize as _, FromNbtTag as _, Serialize as _}; -use std::fmt::Display; use tracing::{debug, trace, warn}; +use crate::{ + base_component::BaseComponent, + style::{ChatFormatting, Style}, + text_component::TextComponent, + translatable_component::{StringOrComponent, TranslatableComponent}, +}; + /// A chat component, basically anything you can see in chat. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Hash)] #[serde(untagged)] diff --git a/azalea-chat/src/style.rs b/azalea-chat/src/style.rs index a8cf5935..a27f3d2a 100755 --- a/azalea-chat/src/style.rs +++ b/azalea-chat/src/style.rs @@ -605,9 +605,8 @@ impl simdnbt::Deserialize for Style { #[cfg(test)] mod tests { - use crate::component::DEFAULT_STYLE; - use super::*; + use crate::component::DEFAULT_STYLE; #[test] fn text_color_named_colors() { diff --git a/azalea-chat/src/text_component.rs b/azalea-chat/src/text_component.rs index 6f95840d..d3418ad8 100755 --- a/azalea-chat/src/text_component.rs +++ b/azalea-chat/src/text_component.rs @@ -1,7 +1,9 @@ -use crate::{base_component::BaseComponent, style::ChatFormatting, FormattedText}; -use serde::{ser::SerializeMap, Serialize, Serializer, __private::ser::FlatMapSerializer}; use std::fmt::Display; +use serde::{ser::SerializeMap, Serialize, Serializer, __private::ser::FlatMapSerializer}; + +use crate::{base_component::BaseComponent, style::ChatFormatting, FormattedText}; + /// A component that contains text that's the same in all locales. #[derive(Clone, Debug, Default, PartialEq, Eq, Hash)] pub struct TextComponent { @@ -140,9 +142,8 @@ impl Display for TextComponent { #[cfg(test)] mod tests { - use crate::style::Ansi; - use super::*; + use crate::style::Ansi; #[test] fn test_hypixel_motd() { diff --git a/azalea-chat/src/translatable_component.rs b/azalea-chat/src/translatable_component.rs index 82c84d85..ecd238a5 100755 --- a/azalea-chat/src/translatable_component.rs +++ b/azalea-chat/src/translatable_component.rs @@ -1,12 +1,13 @@ use std::fmt::{self, Display, Formatter}; -use crate::{ - base_component::BaseComponent, style::Style, text_component::TextComponent, FormattedText, -}; use serde::{ser::SerializeMap, Serialize, Serializer, __private::ser::FlatMapSerializer}; #[cfg(feature = "simdnbt")] use simdnbt::Serialize as _; +use crate::{ + base_component::BaseComponent, style::Style, text_component::TextComponent, FormattedText, +}; + #[derive(Clone, Debug, PartialEq, Serialize, Eq, Hash)] #[serde(untagged)] pub enum StringOrComponent { |
