From 2cd6f736c2dbe0025482517926046762880030c7 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 17 Aug 2023 00:10:14 -0400 Subject: [PATCH] Fix building without compare feature. --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index b48fab1..33879e9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,10 +37,14 @@ fn main() -> Result<(), Box> { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn main_body() -> Result<(), Box> { + #[cfg(not(feature = "compare"))] + let org_contents = ""; + #[cfg(feature = "compare")] let org_contents = read_stdin_to_string()?; run_compare(org_contents) } +#[cfg(feature = "compare")] fn read_stdin_to_string() -> Result> { let mut stdin_contents = String::new(); std::io::stdin() @@ -75,7 +79,7 @@ fn run_compare>(org_contents: P) -> Result<(), Box>(_todo_org_path: P) -> Result<(), Box> { +fn run_compare>(_org_contents: P) -> Result<(), Box> { println!("This program was built with compare disabled. Doing nothing."); Ok(()) }