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:
parent
c13cb8afcf
commit
210af2916d
1 changed files with 9 additions and 7 deletions
|
@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue