aboutsummaryrefslogtreecommitdiff
path: root/azalea-chat/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-10-27 21:22:47 -0500
committermat <github@matdoes.dev>2022-10-27 21:22:47 -0500
commit9de6c03dfbaa08890b1ec8322a97b7097d4a9d37 (patch)
treef8a2e96893036b32ab2299df49fa5b88fb5187da /azalea-chat/src
parent7ae8bfab5095b8d6fe71f32a0b1cda8a47ccff94 (diff)
downloadazalea-drasl-9de6c03dfbaa08890b1ec8322a97b7097d4a9d37.tar.xz
use variables directly in format strings
thanks clippy we love you
Diffstat (limited to 'azalea-chat/src')
-rwxr-xr-xazalea-chat/src/component.rs4
-rw-r--r--azalea-chat/src/translatable_component.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs
index 12df03cd..6dd11084 100755
--- a/azalea-chat/src/component.rs
+++ b/azalea-chat/src/component.rs
@@ -186,7 +186,7 @@ impl<'de> Deserialize<'de> for Component {
nbt
} else {
return Err(de::Error::custom(
- format!("Don't know how to turn {} into a Component", json).as_str(),
+ format!("Don't know how to turn {json} into a Component").as_str(),
));
};
let _separator = Component::parse_separator(&json).map_err(de::Error::custom)?;
@@ -223,7 +223,7 @@ impl<'de> Deserialize<'de> for Component {
// ok so it's not an object, if it's an array deserialize every item
else if !json.is_array() {
return Err(de::Error::custom(
- format!("Don't know how to turn {} into a Component", json).as_str(),
+ format!("Don't know how to turn {json} into a Component").as_str(),
));
}
let json_array = json.as_array().unwrap();
diff --git a/azalea-chat/src/translatable_component.rs b/azalea-chat/src/translatable_component.rs
index 918c2c42..7c01819b 100644
--- a/azalea-chat/src/translatable_component.rs
+++ b/azalea-chat/src/translatable_component.rs
@@ -134,8 +134,8 @@ impl Display for TranslatableComponent {
impl Display for StringOrComponent {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), fmt::Error> {
match self {
- StringOrComponent::String(s) => write!(f, "{}", s),
- StringOrComponent::Component(c) => write!(f, "{}", c),
+ StringOrComponent::String(s) => write!(f, "{s}"),
+ StringOrComponent::Component(c) => write!(f, "{c}"),
}
}
}