fix clippy error

This commit is contained in:
Dominik Kundel 2025-08-08 18:05:27 -07:00
parent 4256452ca2
commit 0f36d0ae5e
No known key found for this signature in database

View file

@ -839,11 +839,10 @@ impl Render<Message> for HarmonyEncoding {
if let Some(constrain_marker) =
self.mapped_format_token(FormattingToken::ConstrainedFormat)
{
if content_type.starts_with(constrain_marker) {
if let Some(rest) = content_type.strip_prefix(constrain_marker) {
// Render the space, then the constrain marker as a special token, then the rest as text (if any)
self.render_text_into(" ", into)?;
self.render_formatting_token_into(FormattingToken::ConstrainedFormat, into)?;
let rest = &content_type[constrain_marker.len()..];
if !rest.is_empty() {
self.render_text_into(rest, into)?;
}