Remove pointless map_err calls.
This commit is contained in:
parent
05c64f53b1
commit
d20b4a410b
@ -35,3 +35,9 @@ impl From<&'static str> for CustomError {
|
|||||||
CustomError::Static(value)
|
CustomError::Static(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<String> for CustomError {
|
||||||
|
fn from(value: String) -> Self {
|
||||||
|
CustomError::Text(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -129,23 +129,12 @@ fn document_org_source<'b, 'g, 'r, 's>(
|
|||||||
})
|
})
|
||||||
.collect::<Result<Vec<_>, _>>()?;
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
for setup_file in setup_files.iter().map(String::as_str) {
|
for setup_file in setup_files.iter().map(String::as_str) {
|
||||||
let (_, setup_file_settings) =
|
let (_, setup_file_settings) = scan_for_in_buffer_settings(setup_file.into())?;
|
||||||
scan_for_in_buffer_settings(setup_file.into()).map_err(|err| {
|
|
||||||
eprintln!("{}", err);
|
|
||||||
nom::Err::Error(CustomError::Static(
|
|
||||||
"TODO: make this take an owned string so I can dump err.to_string() into it.",
|
|
||||||
))
|
|
||||||
})?;
|
|
||||||
final_settings.extend(setup_file_settings);
|
final_settings.extend(setup_file_settings);
|
||||||
}
|
}
|
||||||
final_settings.extend(document_settings);
|
final_settings.extend(document_settings);
|
||||||
let new_settings = apply_in_buffer_settings(final_settings, context.get_global_settings())
|
let new_settings = apply_in_buffer_settings(final_settings, context.get_global_settings())
|
||||||
.map_err(|err| {
|
.map_err(|err| nom::Err::Error(CustomError::from(err)))?;
|
||||||
eprintln!("{}", err);
|
|
||||||
nom::Err::Error(CustomError::Static(
|
|
||||||
"TODO: make this take an owned string so I can dump err.to_string() into it.",
|
|
||||||
))
|
|
||||||
})?;
|
|
||||||
let new_context = context.with_global_settings(&new_settings);
|
let new_context = context.with_global_settings(&new_settings);
|
||||||
let context = &new_context;
|
let context = &new_context;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user