refactor: Refactored to use more idiomatic let-else statements where applicable
This commit is contained in:
1 parent
ad58912baf
commit
e50fb88bfc
43 files changed
+1337
-1291
No files matched your search
@@ -31,11 +31,10 @@ pub(super) struct AddMovieUi;
|
||||
|
||||
impl DrawUi for AddMovieUi {
|
||||
fn accepts(route: Route) -> bool {
|
||||
if let Route::Radarr(active_radarr_block, _) = route {
|
||||
return ADD_MOVIE_BLOCKS.contains(&active_radarr_block);
|
||||
}
|
||||
|
||||
false
|
||||
let Route::Radarr(active_radarr_block, _) = route else {
|
||||
return false;
|
||||
};
|
||||
ADD_MOVIE_BLOCKS.contains(&active_radarr_block)
|
||||
}
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
|
||||
@@ -17,11 +17,10 @@ pub(super) struct DeleteMovieUi;
|
||||
|
||||
impl DrawUi for DeleteMovieUi {
|
||||
fn accepts(route: Route) -> bool {
|
||||
if let Route::Radarr(active_radarr_block, _) = route {
|
||||
return DELETE_MOVIE_BLOCKS.contains(&active_radarr_block);
|
||||
}
|
||||
|
||||
false
|
||||
let Route::Radarr(active_radarr_block, _) = route else {
|
||||
return false;
|
||||
};
|
||||
DELETE_MOVIE_BLOCKS.contains(&active_radarr_block)
|
||||
}
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, _area: Rect) {
|
||||
|
||||
@@ -31,11 +31,10 @@ pub(super) struct EditMovieUi;
|
||||
|
||||
impl DrawUi for EditMovieUi {
|
||||
fn accepts(route: Route) -> bool {
|
||||
if let Route::Radarr(active_radarr_block, _) = route {
|
||||
return EDIT_MOVIE_BLOCKS.contains(&active_radarr_block);
|
||||
}
|
||||
|
||||
false
|
||||
let Route::Radarr(active_radarr_block, _) = route else {
|
||||
return false;
|
||||
};
|
||||
EDIT_MOVIE_BLOCKS.contains(&active_radarr_block)
|
||||
}
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, _area: Rect) {
|
||||
|
||||
@@ -32,11 +32,10 @@ pub(super) struct MovieDetailsUi;
|
||||
|
||||
impl DrawUi for MovieDetailsUi {
|
||||
fn accepts(route: Route) -> bool {
|
||||
if let Route::Radarr(active_radarr_block, _) = route {
|
||||
return MOVIE_DETAILS_BLOCKS.contains(&active_radarr_block);
|
||||
}
|
||||
|
||||
false
|
||||
let Route::Radarr(active_radarr_block, _) = route else {
|
||||
return false;
|
||||
};
|
||||
MOVIE_DETAILS_BLOCKS.contains(&active_radarr_block)
|
||||
}
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, _area: Rect) {
|
||||
|
||||
Reference in new issue
Block a user