mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 09:10:08 +00:00
reduce code
This commit is contained in:
parent
3d5ca91021
commit
78b7c67038
@ -30,17 +30,13 @@ pub fn format(source_code: &str) -> Vec<(TextTag, String)> {
|
||||
.set_background_rgba(Some(&color_to_rgba(color)));
|
||||
}
|
||||
|
||||
if let Some(is_italic) = entity.italic {
|
||||
if is_italic {
|
||||
if entity.italic.is_some_and(|is_italic| is_italic) {
|
||||
tag.text_tag.set_style(Style::Italic);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(is_underline) = entity.underline {
|
||||
if is_underline {
|
||||
if entity.underline.is_some_and(|is_underline| is_underline) {
|
||||
tag.text_tag.set_underline(Underline::Single);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(is_strikethrough) = entity.strikethrough {
|
||||
tag.text_tag.set_strikethrough(is_strikethrough);
|
||||
|
Loading…
x
Reference in New Issue
Block a user