diff --git a/src/wasm.rs b/src/wasm.rs index 52d7f20..77dccb2 100644 --- a/src/wasm.rs +++ b/src/wasm.rs @@ -35,8 +35,8 @@ pub fn get_mediawiki_commit() -> String { env!("MEDIAWIKI_COMMIT_HASH").into() } #[wasm_bindgen] -pub fn get_opencc_commit() -> String { - env!("OPENCC_COMMIT_HASH").into() +pub fn get_opencc_commit() -> Option { + option_env!("OPENCC_COMMIT_HASH").map(|s| s.into()) } /// Convert a text to a target Chinese variant.