Skip to content

Commit 9dad659

Browse files
samueltardieuKeats
authored andcommitted
chore(components/config): cleanup code (#2592)
Cleanup code by using `Option::is_some_and()` and `Option::as_deref()` instead of recoding them.
1 parent 9594fa8 commit 9dad659

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

components/config/src/config/taxonomies.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,10 @@ impl Default for TaxonomyConfig {
3232

3333
impl TaxonomyConfig {
3434
pub fn is_paginated(&self) -> bool {
35-
if let Some(paginate_by) = self.paginate_by {
36-
paginate_by > 0
37-
} else {
38-
false
39-
}
35+
self.paginate_by.is_some_and(|paginate_by| paginate_by > 0)
4036
}
4137

4238
pub fn paginate_path(&self) -> &str {
43-
if let Some(ref path) = self.paginate_path {
44-
path
45-
} else {
46-
"page"
47-
}
39+
self.paginate_path.as_deref().unwrap_or("page")
4840
}
4941
}

0 commit comments

Comments
 (0)