From 44ad6753ca2ed2729c945a08d3a913efe3e6378b Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 10 Aug 2023 20:21:39 -0400 Subject: [PATCH] Fix feature gating the compare code. --- src/main.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.rs b/src/main.rs index 3ad6b6f..c950d02 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,13 @@ #![feature(round_char_boundary)] use std::path::Path; +#[cfg(feature = "compare")] use ::organic::parser::document; +#[cfg(feature = "compare")] use organic::compare_document; +#[cfg(feature = "compare")] use organic::emacs_parse_org_document; +#[cfg(feature = "compare")] use organic::parser::sexp::sexp_with_padding; use crate::init_tracing::init_telemetry; @@ -21,6 +25,7 @@ fn main() -> Result<(), Box> { Ok(()) } +#[cfg(feature = "compare")] fn run_compare>(todo_org_path: P) -> Result<(), Box> { let org_contents = std::fs::read_to_string(todo_org_path.as_ref()).expect("Read org file."); let (remaining, rust_parsed) = document(org_contents.as_str()).expect("Org Parse failure"); @@ -49,3 +54,9 @@ fn run_compare>(todo_org_path: P) -> Result<(), Box>(_todo_org_path: P) -> Result<(), Box> { + println!("This program was built with compare disabled. Doing nothing."); + Ok(()) +}