From 4d780907c4396ceea33baffb2a9e9a28dabcbcef Mon Sep 17 00:00:00 2001 From: SimonThormeyer Date: Thu, 21 Nov 2024 12:27:51 +0100 Subject: [PATCH] refactor(wasm): change fields of BuildMetadata to camelCase To comply to javascript conventions. This is desirable because we expose this struct beyond our typescript wrapper. It has to be this tedious way of renaming each field separately, until rustwasm/wasm-bindgen#1818 is solved. --- crypto-ffi/src/wasm/mod.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crypto-ffi/src/wasm/mod.rs b/crypto-ffi/src/wasm/mod.rs index ef744e7c33..f050ed96a6 100644 --- a/crypto-ffi/src/wasm/mod.rs +++ b/crypto-ffi/src/wasm/mod.rs @@ -46,28 +46,28 @@ pub struct BuildMetadata { #[wasm_bindgen(readonly)] pub timestamp: &'static str, /// Whether this build was in Debug mode (true) or Release mode (false) - #[wasm_bindgen(readonly)] + #[wasm_bindgen(readonly, js_name = "cargoDebug")] pub cargo_debug: &'static str, /// Features enabled for this build - #[wasm_bindgen(readonly)] + #[wasm_bindgen(readonly, js_name = "cargoFeatures")] pub cargo_features: &'static str, /// Optimization level - #[wasm_bindgen(readonly)] + #[wasm_bindgen(readonly, js_name = "optLevel")] pub opt_level: &'static str, /// Build target triple - #[wasm_bindgen(readonly)] + #[wasm_bindgen(readonly, js_name = "targetTriple")] pub target_triple: &'static str, /// Git branch - #[wasm_bindgen(readonly)] + #[wasm_bindgen(readonly, js_name = "gitBranch")] pub git_branch: &'static str, /// Output of `git describe` - #[wasm_bindgen(readonly)] + #[wasm_bindgen(readonly, js_name = "gitDescribe")] pub git_describe: &'static str, /// Hash of current git commit - #[wasm_bindgen(readonly)] + #[wasm_bindgen(readonly, js_name = "gitSha")] pub git_sha: &'static str, /// `true` when the source code differed from the commit at the most recent git hash - #[wasm_bindgen(readonly)] + #[wasm_bindgen(readonly, js_name = "gitDirty")] pub git_dirty: &'static str, }