mirror of
https://github.com/ratatui/ratatui.git
synced 2025-10-03 07:45:59 +00:00
refactor: clippy::if_not_else (#974)
This commit is contained in:
parent
5ed1f43c62
commit
14b24e7585
@ -73,6 +73,7 @@ doc_markdown = "warn"
|
|||||||
empty_line_after_doc_comments = "warn"
|
empty_line_after_doc_comments = "warn"
|
||||||
equatable_if_let = "warn"
|
equatable_if_let = "warn"
|
||||||
explicit_iter_loop = "warn"
|
explicit_iter_loop = "warn"
|
||||||
|
if_not_else = "warn"
|
||||||
implicit_clone = "warn"
|
implicit_clone = "warn"
|
||||||
inefficient_to_string = "warn"
|
inefficient_to_string = "warn"
|
||||||
items_after_statements = "warn"
|
items_after_statements = "warn"
|
||||||
|
@ -99,7 +99,12 @@ impl<'a, DS: DateStyler> Monthly<'a, DS> {
|
|||||||
|
|
||||||
/// All logic to style a date goes here.
|
/// All logic to style a date goes here.
|
||||||
fn format_date(&self, date: Date) -> Span {
|
fn format_date(&self, date: Date) -> Span {
|
||||||
if date.month() != self.display_date.month() {
|
if date.month() == self.display_date.month() {
|
||||||
|
Span::styled(
|
||||||
|
format!("{:2?}", date.day()),
|
||||||
|
self.default_style.patch(self.events.get_style(date)),
|
||||||
|
)
|
||||||
|
} else {
|
||||||
match self.show_surrounding {
|
match self.show_surrounding {
|
||||||
None => Span::styled(" ", self.default_bg()),
|
None => Span::styled(" ", self.default_bg()),
|
||||||
Some(s) => {
|
Some(s) => {
|
||||||
@ -110,11 +115,6 @@ impl<'a, DS: DateStyler> Monthly<'a, DS> {
|
|||||||
Span::styled(format!("{:2?}", date.day()), style)
|
Span::styled(format!("{:2?}", date.day()), style)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Span::styled(
|
|
||||||
format!("{:2?}", date.day()),
|
|
||||||
self.default_style.patch(self.events.get_style(date)),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user