mirror of
https://github.com/getzola/zola
synced 2024-11-10 06:14:19 +00:00
chore(components/config): cleanup code (#2592)
Cleanup code by using `Option::is_some_and()` and `Option::as_deref()` instead of recoding them.
This commit is contained in:
parent
9594fa8d06
commit
9dad659665
1 changed files with 2 additions and 10 deletions
|
@ -32,18 +32,10 @@ impl Default for TaxonomyConfig {
|
|||
|
||||
impl TaxonomyConfig {
|
||||
pub fn is_paginated(&self) -> bool {
|
||||
if let Some(paginate_by) = self.paginate_by {
|
||||
paginate_by > 0
|
||||
} else {
|
||||
false
|
||||
}
|
||||
self.paginate_by.is_some_and(|paginate_by| paginate_by > 0)
|
||||
}
|
||||
|
||||
pub fn paginate_path(&self) -> &str {
|
||||
if let Some(ref path) = self.paginate_path {
|
||||
path
|
||||
} else {
|
||||
"page"
|
||||
}
|
||||
self.paginate_path.as_deref().unwrap_or("page")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue