diff options
| author | mat <github@matdoes.dev> | 2022-12-08 18:39:35 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-12-08 18:39:35 -0600 |
| commit | 70e2dfed16da8d5130460ea15b47701e622f4a9f (patch) | |
| tree | 41f670baf3a05ed180880ec2a11d8e5f6a1a1599 /azalea-chat/src/component.rs | |
| parent | f2076daba5cfcce81399b075ba9258fbdc2012fa (diff) | |
| download | azalea-drasl-70e2dfed16da8d5130460ea15b47701e622f4a9f.tar.xz | |
wrap_comments = true
Diffstat (limited to 'azalea-chat/src/component.rs')
| -rwxr-xr-x | azalea-chat/src/component.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs index 3a232ee5..ea485049 100755 --- a/azalea-chat/src/component.rs +++ b/azalea-chat/src/component.rs @@ -61,8 +61,8 @@ impl Component { /// [ANSI string](https://en.wikipedia.org/wiki/ANSI_escape_code), so you /// can print it to your terminal and get styling. /// - /// This is technically a shortcut for [`Component::to_ansi_custom_style`] with a - /// default [`Style`] colored white. + /// This is technically a shortcut for [`Component::to_ansi_custom_style`] + /// with a default [`Style`] colored white. /// /// # Examples /// @@ -166,8 +166,9 @@ impl<'de> Deserialize<'de> for Component { .ok_or_else(|| de::Error::custom("\"with\" must be an array"))?; let mut with_array = Vec::with_capacity(with.len()); for item in with { - // if it's a string component with no styling and no siblings, just add a string to with_array - // otherwise add the component to the array + // if it's a string component with no styling and no siblings, just add a + // string to with_array otherwise add the component + // to the array let c = Component::deserialize(item).map_err(de::Error::custom)?; if let Component::Text(text_component) = c { if text_component.base.siblings.is_empty() @@ -253,7 +254,8 @@ impl<'de> Deserialize<'de> for Component { )); } let json_array = json.as_array().unwrap(); - // the first item in the array is the one that we're gonna return, the others are siblings + // the first item in the array is the one that we're gonna return, the others + // are siblings let mut component = Component::deserialize(&json_array[0]).map_err(de::Error::custom)?; for i in 1..json_array.len() { component.append( |
