Apply more suggestions.
This commit is contained in:
@@ -20,8 +20,7 @@ impl FileAccessInterface for LocalFileAccessInterface {
|
||||
fn read_file(&self, path: &str) -> Result<String, std::io::Error> {
|
||||
let final_path = self
|
||||
.working_directory
|
||||
.as_ref()
|
||||
.map(PathBuf::as_path)
|
||||
.as_deref()
|
||||
.map(|pb| pb.join(path))
|
||||
.unwrap_or_else(|| PathBuf::from(path));
|
||||
Ok(std::fs::read_to_string(final_path)?)
|
||||
|
||||
@@ -126,14 +126,10 @@ impl<'g, 's> Default for GlobalSettings<'g, 's> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, Default)]
|
||||
pub enum HeadlineLevelFilter {
|
||||
Odd,
|
||||
|
||||
#[default]
|
||||
OddEven,
|
||||
}
|
||||
|
||||
impl Default for HeadlineLevelFilter {
|
||||
fn default() -> Self {
|
||||
HeadlineLevelFilter::OddEven
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ impl<'a, T> Iterator for IterList<'a, T> {
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let ret = self.next;
|
||||
self.next = self.next.map(|this| this.get_parent()).flatten();
|
||||
self.next = self.next.and_then(|link| link.get_parent());
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ pub(crate) use parser_with_context;
|
||||
|
||||
macro_rules! bind_context {
|
||||
($target:expr, $context:expr) => {
|
||||
move |i| $target($context, i)
|
||||
|i| $target($context, i)
|
||||
};
|
||||
}
|
||||
pub(crate) use bind_context;
|
||||
|
||||
Reference in New Issue
Block a user