From 73b34b7e63506cef266aa95762c40b90d2cabae0 Mon Sep 17 00:00:00 2001 From: vms Date: Sun, 23 Aug 2020 03:18:24 +0300 Subject: [PATCH] rename feature --- crates/macro/Cargo.toml | 2 +- crates/main/Cargo.toml | 5 +---- crates/main/src/call_parameters.rs | 2 +- crates/main/src/lib.rs | 2 +- crates/wit/Cargo.toml | 2 +- crates/wit/src/parsed_type/foreign_mod_epilog.rs | 4 ++-- crates/wit/src/token_stream_generator/record_generator.rs | 2 +- 7 files changed, 8 insertions(+), 11 deletions(-) diff --git a/crates/macro/Cargo.toml b/crates/macro/Cargo.toml index 261bf93..63b91dc 100644 --- a/crates/macro/Cargo.toml +++ b/crates/macro/Cargo.toml @@ -21,4 +21,4 @@ fluence-sdk-wit = { path = "../wit", version = "=0.2.0" } [features] # Indicates that this crate is included to the Fluence Rust sdk (it affects internal path adjusting) -fce = ["fluence-sdk-wit/fce"] +used_in_sdk = ["fluence-sdk-wit/used_in_sdk"] diff --git a/crates/main/Cargo.toml b/crates/main/Cargo.toml index db657f3..4dde65e 100644 --- a/crates/main/Cargo.toml +++ b/crates/main/Cargo.toml @@ -19,7 +19,7 @@ crate-type = ["rlib"] [dependencies] log = { version = "0.4.8", features = ["std"] } -fluence-sdk-macro = { path = "../macro", features = ["fce"] } +fluence-sdk-macro = { path = "../macro", features = ["used_in_sdk"] } serde = "1.0.115" [dev-dependencies] @@ -32,6 +32,3 @@ debug = [] # Enable logger (this will cause log_utf8_string to appear in imports) logger = [] - -# Indicates that this crate is included to the Fluence Rust sdk (it affects internal path adjusting) -fce = ["fluence-sdk-macro/fce"] diff --git a/crates/main/src/call_parameters.rs b/crates/main/src/call_parameters.rs index 4a231f4..34ce3ab 100644 --- a/crates/main/src/call_parameters.rs +++ b/crates/main/src/call_parameters.rs @@ -37,7 +37,7 @@ impl CallParameters { } } -#[cfg(not(feature = "fce"))] +#[cfg(not(feature = "used_in_sdk"))] #[fce] #[link(wasm_import_module = "host")] #[allow(improper_ctypes)] diff --git a/crates/main/src/lib.rs b/crates/main/src/lib.rs index c13f1db..f9286d1 100644 --- a/crates/main/src/lib.rs +++ b/crates/main/src/lib.rs @@ -38,7 +38,7 @@ mod logger; mod result; pub use call_parameters::CallParameters; -#[cfg(not(feature = "fce"))] +#[cfg(not(feature = "used_in_sdk"))] pub use call_parameters::get_call_parameters; pub use export_allocator::allocate; pub use export_allocator::deallocate; diff --git a/crates/wit/Cargo.toml b/crates/wit/Cargo.toml index 3177866..8aa7f63 100644 --- a/crates/wit/Cargo.toml +++ b/crates/wit/Cargo.toml @@ -23,4 +23,4 @@ uuid = { version = "0.8.1", features = ["v4"] } [features] # Indicates that this crate is included to the Fluence Rust sdk (it affects internal path adjusting) -fce = [] +used_in_sdk = [] diff --git a/crates/wit/src/parsed_type/foreign_mod_epilog.rs b/crates/wit/src/parsed_type/foreign_mod_epilog.rs index 2829ea0..4095b6e 100644 --- a/crates/wit/src/parsed_type/foreign_mod_epilog.rs +++ b/crates/wit/src/parsed_type/foreign_mod_epilog.rs @@ -73,12 +73,12 @@ impl ForeignModEpilogGlueCodeGenerator for Option { } } -#[cfg(not(feature = "fce"))] +#[cfg(not(feature = "used_in_sdk"))] fn get_crate_path() -> proc_macro2::TokenStream { quote! { fluence::internal } } -#[cfg(feature = "fce")] +#[cfg(feature = "used_in_sdk")] fn get_crate_path() -> proc_macro2::TokenStream { quote! { crate } } diff --git a/crates/wit/src/token_stream_generator/record_generator.rs b/crates/wit/src/token_stream_generator/record_generator.rs index 3ac00ce..512d6f2 100644 --- a/crates/wit/src/token_stream_generator/record_generator.rs +++ b/crates/wit/src/token_stream_generator/record_generator.rs @@ -43,7 +43,7 @@ impl quote::ToTokens for fce_ast_types::AstRecordItem { let glue_code = quote::quote! { #original - #[cfg(any(target_arch = "wasm32", feature = "fce"))] + #[cfg(any(target_arch = "wasm32", feature = "used_in_sdk"))] #[doc(hidden)] #[allow(clippy::all)] impl #record_name {