30
30
#[ cfg( feature = "dcutr" ) ]
31
31
mod dcutr;
32
32
#[ cfg( feature = "gossipsub" ) ]
33
- #[ cfg( not( target_os = "unknown" ) ) ]
33
+ #[ cfg( any ( not( target_os = "unknown" ) , target_arch = "wasm32 ") ) ]
34
34
mod gossipsub;
35
35
#[ cfg( feature = "identify" ) ]
36
36
mod identify;
@@ -50,7 +50,7 @@ pub struct Metrics {
50
50
#[ cfg( feature = "dcutr" ) ]
51
51
dcutr : dcutr:: Metrics ,
52
52
#[ cfg( feature = "gossipsub" ) ]
53
- #[ cfg( not( target_os = "unknown" ) ) ]
53
+ #[ cfg( any ( not( target_os = "unknown" ) , target_arch = "wasm32 ") ) ]
54
54
gossipsub : gossipsub:: Metrics ,
55
55
#[ cfg( feature = "identify" ) ]
56
56
identify : identify:: Metrics ,
@@ -78,7 +78,7 @@ impl Metrics {
78
78
#[ cfg( feature = "dcutr" ) ]
79
79
dcutr : dcutr:: Metrics :: new ( sub_registry) ,
80
80
#[ cfg( feature = "gossipsub" ) ]
81
- #[ cfg( not( target_os = "unknown" ) ) ]
81
+ #[ cfg( any ( not( target_os = "unknown" ) , target_arch = "wasm32 ") ) ]
82
82
gossipsub : gossipsub:: Metrics :: new ( sub_registry) ,
83
83
#[ cfg( feature = "identify" ) ]
84
84
identify : identify:: Metrics :: new ( sub_registry) ,
@@ -107,7 +107,7 @@ impl Recorder<libp2p_dcutr::Event> for Metrics {
107
107
}
108
108
109
109
#[ cfg( feature = "gossipsub" ) ]
110
- #[ cfg( not( target_os = "unknown" ) ) ]
110
+ #[ cfg( any ( not( target_os = "unknown" ) , target_arch = "wasm32 ") ) ]
111
111
impl Recorder < libp2p_gossipsub:: Event > for Metrics {
112
112
fn record ( & self , event : & libp2p_gossipsub:: Event ) {
113
113
self . gossipsub . record ( event)
0 commit comments