summaryrefslogtreecommitdiff
path: root/support/texlab/src/options.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/src/options.rs')
-rw-r--r--support/texlab/src/options.rs24
1 files changed, 14 insertions, 10 deletions
diff --git a/support/texlab/src/options.rs b/support/texlab/src/options.rs
index 211b3468c4..fe0d81c639 100644
--- a/support/texlab/src/options.rs
+++ b/support/texlab/src/options.rs
@@ -85,22 +85,26 @@ pub struct BuildOptions {
}
impl BuildOptions {
+ #[must_use]
pub fn executable(&self) -> String {
self.executable
.as_ref()
- .map(Clone::clone)
- .unwrap_or_else(|| "latexmk".to_string())
+ .map_or_else(|| "latexmk".to_string(), Clone::clone)
}
+ #[must_use]
pub fn args(&self) -> Vec<String> {
- self.args.as_ref().map(Clone::clone).unwrap_or_else(|| {
- vec![
- "-pdf".to_string(),
- "-interaction=nonstopmode".to_string(),
- "-synctex=1".to_string(),
- "%f".to_string(),
- ]
- })
+ self.args.as_ref().map_or_else(
+ || {
+ vec![
+ "-pdf".to_string(),
+ "-interaction=nonstopmode".to_string(),
+ "-synctex=1".to_string(),
+ "%f".to_string(),
+ ]
+ },
+ Clone::clone,
+ )
}
}