Refactor wasm feature gates.
This commit is contained in:
@@ -702,15 +702,11 @@ impl Module {
|
||||
) -> &mut Self {
|
||||
self.update_fn_metadata(hash_fn, arg_names);
|
||||
|
||||
if !comments.as_ref().is_empty() {
|
||||
let comments = comments.as_ref();
|
||||
|
||||
if !comments.is_empty() {
|
||||
let f = self.functions.get_mut(&hash_fn).expect("exists");
|
||||
f.comments = Some(
|
||||
comments
|
||||
.as_ref()
|
||||
.iter()
|
||||
.map(|s| s.as_ref().into())
|
||||
.collect(),
|
||||
);
|
||||
f.comments = Some(comments.iter().map(|s| s.as_ref().into()).collect());
|
||||
}
|
||||
|
||||
self
|
||||
@@ -869,15 +865,11 @@ impl Module {
|
||||
) -> u64 {
|
||||
let hash = self.set_fn(name, namespace, access, arg_names, arg_types, func);
|
||||
|
||||
if !comments.as_ref().is_empty() {
|
||||
let comments = comments.as_ref();
|
||||
|
||||
if !comments.is_empty() {
|
||||
let f = self.functions.get_mut(&hash).expect("exists");
|
||||
f.comments = Some(
|
||||
comments
|
||||
.as_ref()
|
||||
.iter()
|
||||
.map(|s| s.as_ref().into())
|
||||
.collect(),
|
||||
);
|
||||
f.comments = Some(comments.iter().map(|s| s.as_ref().into()).collect());
|
||||
}
|
||||
|
||||
hash
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#![cfg(not(feature = "no_std"))]
|
||||
#![cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))]
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
#![cfg(not(target_arch = "wasm64"))]
|
||||
|
||||
use crate::func::native::shared_write_lock;
|
||||
use crate::{
|
||||
|
@@ -11,7 +11,8 @@ mod stat;
|
||||
pub use collection::ModuleResolversCollection;
|
||||
pub use dummy::DummyModuleResolver;
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(target_arch = "wasm64"))]
|
||||
pub use file::FileModuleResolver;
|
||||
pub use stat::StaticModuleResolver;
|
||||
|
||||
|
Reference in New Issue
Block a user