summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorEric Huss <eric@huss.org>2023-09-02 16:41:59 -0700
committerEric Huss <eric@huss.org>2023-09-02 16:41:59 -0700
commit4749f9d97a7a9bc7b489cfccc342f110544ec458 (patch)
treeb20dbc968cdb1b49ad4d58b2e13b2b1d73f53192 /src/config.rs
parent8564a7fb51f83f39b01618ec14d3e68d98e7ac48 (diff)
Some minor corrections from code review.
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/config.rs b/src/config.rs
index 8a20e4f3..bcbb28bc 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -412,7 +412,7 @@ pub struct BookConfig {
/// The main language of the book.
pub language: Option<String>,
/// The direction of text in the book: Left-to-right (LTR) or Right-to-left (RTL).
- /// When not specified, the correct text direction is derived from [BookConfig::language].
+ /// When not specified, the text direction is derived from [`BookConfig::language`].
pub text_direction: Option<TextDirection>,
}
@@ -431,13 +431,13 @@ impl Default for BookConfig {
}
impl BookConfig {
- /// Gets the realized text direction, either from [BookConfig::text_direction]
- /// or derived from [BookConfig::language], to be used by templating engines.
+ /// Gets the realized text direction, either from [`BookConfig::text_direction`]
+ /// or derived from [`BookConfig::language`], to be used by templating engines.
pub fn realized_text_direction(&self) -> TextDirection {
if let Some(direction) = self.text_direction {
direction
} else {
- TextDirection::from_lang_code(&self.language.clone().unwrap_or_default())
+ TextDirection::from_lang_code(self.language.as_deref().unwrap_or_default())
}
}
}