1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

cargo lint and fmt

This commit is contained in:
Kumpelinus 2025-03-20 18:57:51 +01:00
parent c13cb8afcf
commit 210af2916d

View file

@ -132,7 +132,7 @@ impl FormattedText {
/// ```
pub fn to_ansi(&self) -> String {
let mut result = self.to_custom_format(
|running, new, default| (running.compare_ansi(new, &default), "".to_owned()),
|running, new, default| (running.compare_ansi(new, default), "".to_owned()),
|text| text.to_string(),
&DEFAULT_STYLE,
);
@ -145,14 +145,16 @@ impl FormattedText {
}
pub fn to_html(&self) -> String {
let result = self.to_custom_format(
|_, new, _| (format!("<span style=\"{}\">", new.get_html_style()), "</span>".to_owned()),
self.to_custom_format(
|_, new, _| {
(
format!("<span style=\"{}\">", new.get_html_style()),
"</span>".to_owned(),
)
},
|text| text.replace("\n", "<br>"),
&DEFAULT_STYLE,
);
// Ensure proper closing of opened spans
result
)
}
}