From 62501febb977591025b666fa5af680a71c11b78f Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Mon, 7 Oct 2019 19:50:17 -0400 Subject: [PATCH] Fix compilation of main method when not on supported platform, works as library cross-platform now --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2f84cf4..4c97f0b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,13 @@ -use rusty_keys::main_res; +#[cfg(any(target_os = "windows", target_os = "linux"))] fn main() { - let ret = main_res(); + let ret = rusty_keys::main_res(); if let Err(e) = ret { println!("fatal error: {}", e); } } + +#[cfg(not(any(target_os = "windows", target_os = "linux")))] +fn main() { + panic!("sorry no main impl for this platform"); +}