Remove unnecessary map_err from main.rs.
All checks were successful
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded

This commit is contained in:
Tom Alexander 2023-09-04 17:29:50 -04:00
parent c7d5c89a60
commit 27cf6c0462
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -68,7 +68,7 @@ fn run_anonymous_parse<P: AsRef<str>>(org_contents: P) -> Result<(), Box<dyn std
let org_contents = org_contents.as_ref(); let org_contents = org_contents.as_ref();
eprintln!("Using emacs version: {}", get_emacs_version()?.trim()); eprintln!("Using emacs version: {}", get_emacs_version()?.trim());
eprintln!("Using org-mode version: {}", get_org_mode_version()?.trim()); eprintln!("Using org-mode version: {}", get_org_mode_version()?.trim());
let rust_parsed = parse(org_contents).map_err(|e| e.to_string())?; let rust_parsed = parse(org_contents)?;
let org_sexp = emacs_parse_anonymous_org_document(org_contents)?; let org_sexp = emacs_parse_anonymous_org_document(org_contents)?;
let (_remaining, parsed_sexp) = let (_remaining, parsed_sexp) =
sexp_with_padding(org_sexp.as_str()).map_err(|e| e.to_string())?; sexp_with_padding(org_sexp.as_str()).map_err(|e| e.to_string())?;
@ -93,7 +93,7 @@ fn run_anonymous_parse<P: AsRef<str>>(org_contents: P) -> Result<(), Box<dyn std
eprintln!( eprintln!(
"This program was built with compare disabled. Only parsing with organic, not comparing." "This program was built with compare disabled. Only parsing with organic, not comparing."
); );
let rust_parsed = parse(org_contents.as_ref()).map_err(|e| e.to_string())?; let rust_parsed = parse(org_contents.as_ref())?;
println!("{:#?}", rust_parsed); println!("{:#?}", rust_parsed);
Ok(()) Ok(())
} }
@ -106,7 +106,7 @@ fn run_parse_on_file<P: AsRef<Path>>(org_path: P) -> Result<(), Box<dyn std::err
// TODO: This should take into account the original file path when parsing in Organic, not just in emacs. // TODO: This should take into account the original file path when parsing in Organic, not just in emacs.
let org_contents = std::fs::read_to_string(org_path)?; let org_contents = std::fs::read_to_string(org_path)?;
let org_contents = org_contents.as_str(); let org_contents = org_contents.as_str();
let rust_parsed = parse(org_contents).map_err(|e| e.to_string())?; let rust_parsed = parse(org_contents)?;
let org_sexp = emacs_parse_file_org_document(org_path)?; let org_sexp = emacs_parse_file_org_document(org_path)?;
let (_remaining, parsed_sexp) = let (_remaining, parsed_sexp) =
sexp_with_padding(org_sexp.as_str()).map_err(|e| e.to_string())?; sexp_with_padding(org_sexp.as_str()).map_err(|e| e.to_string())?;
@ -135,7 +135,7 @@ fn run_parse_on_file<P: AsRef<Path>>(org_path: P) -> Result<(), Box<dyn std::err
// TODO: This should take into account the original file path when parsing // TODO: This should take into account the original file path when parsing
let org_contents = std::fs::read_to_string(org_path)?; let org_contents = std::fs::read_to_string(org_path)?;
let org_contents = org_contents.as_str(); let org_contents = org_contents.as_str();
let rust_parsed = parse(org_contents).map_err(|e| e.to_string())?; let rust_parsed = parse(org_contents)?;
println!("{:#?}", rust_parsed); println!("{:#?}", rust_parsed);
Ok(()) Ok(())
} }