mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-22 12:43:16 +00:00
refactor: clippy::if_not_else (#974)
This commit is contained in:
parent
5ed1f43c62
commit
14b24e7585
2 changed files with 7 additions and 6 deletions
|
@ -73,6 +73,7 @@ doc_markdown = "warn"
|
|||
empty_line_after_doc_comments = "warn"
|
||||
equatable_if_let = "warn"
|
||||
explicit_iter_loop = "warn"
|
||||
if_not_else = "warn"
|
||||
implicit_clone = "warn"
|
||||
inefficient_to_string = "warn"
|
||||
items_after_statements = "warn"
|
||||
|
|
|
@ -99,7 +99,12 @@ impl<'a, DS: DateStyler> Monthly<'a, DS> {
|
|||
|
||||
/// All logic to style a date goes here.
|
||||
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 {
|
||||
None => Span::styled(" ", self.default_bg()),
|
||||
Some(s) => {
|
||||
|
@ -110,11 +115,6 @@ impl<'a, DS: DateStyler> Monthly<'a, DS> {
|
|||
Span::styled(format!("{:2?}", date.day()), style)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Span::styled(
|
||||
format!("{:2?}", date.day()),
|
||||
self.default_style.patch(self.events.get_style(date)),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue