@@ -2,17 +2,17 @@ use std::cell::RefCell;
2
2
use std:: rc:: { Rc , Weak } ;
3
3
use std:: sync:: atomic:: { AtomicU32 , Ordering } ;
4
4
5
- #[ cfg( not( feature = "wasi" ) ) ]
5
+ #[ cfg( not( target_os = "wasi" ) ) ]
6
6
use wasm_bindgen:: throw_str;
7
7
8
- #[ cfg( any( not( target_arch = "wasm32" ) , feature = "wasi" ) ) ]
8
+ #[ cfg( any( not( target_arch = "wasm32" ) , target_os = "wasi" ) ) ]
9
9
pub ( crate ) fn get_id ( ) -> u32 {
10
10
static ID_CTR : AtomicU32 = AtomicU32 :: new ( 0 ) ;
11
11
12
12
ID_CTR . fetch_add ( 1 , Ordering :: SeqCst )
13
13
}
14
14
15
- #[ cfg( all( target_arch = "wasm32" , not( feature = "wasi" ) ) ) ]
15
+ #[ cfg( all( target_arch = "wasm32" , not( target_os = "wasi" ) ) ) ]
16
16
pub ( crate ) fn get_id ( ) -> u32 {
17
17
static ID_CTR : AtomicU32 = AtomicU32 :: new ( 0 ) ;
18
18
static INIT : std:: sync:: Once = std:: sync:: Once :: new ( ) ;
@@ -31,27 +31,27 @@ pub(crate) fn get_id() -> u32 {
31
31
32
32
pub ( crate ) fn assert_absolute_path ( path : & str ) {
33
33
if !path. starts_with ( '/' ) {
34
- #[ cfg( not( feature = "wasi" ) ) ]
34
+ #[ cfg( not( target_os = "wasi" ) ) ]
35
35
throw_str ( "You cannot use relative path with this history type." ) ;
36
- #[ cfg( feature = "wasi" ) ]
36
+ #[ cfg( target_os = "wasi" ) ]
37
37
panic ! ( "You cannot use relative path with this history type." ) ;
38
38
}
39
39
}
40
40
41
41
pub ( crate ) fn assert_no_query ( path : & str ) {
42
42
if path. contains ( '?' ) {
43
- #[ cfg( not( feature = "wasi" ) ) ]
43
+ #[ cfg( not( target_os = "wasi" ) ) ]
44
44
throw_str ( "You cannot have query in path, try use a variant of this method with `_query`." ) ;
45
- #[ cfg( feature = "wasi" ) ]
45
+ #[ cfg( target_os = "wasi" ) ]
46
46
panic ! ( "You cannot have query in path, try use a variant of this method with `_query`." ) ;
47
47
}
48
48
}
49
49
50
50
pub ( crate ) fn assert_no_fragment ( path : & str ) {
51
51
if path. contains ( '#' ) {
52
- #[ cfg( not( feature = "wasi" ) ) ]
52
+ #[ cfg( not( target_os = "wasi" ) ) ]
53
53
throw_str ( "You cannot use fragments (hash) in memory history." ) ;
54
- #[ cfg( feature = "wasi" ) ]
54
+ #[ cfg( target_os = "wasi" ) ]
55
55
panic ! ( "You cannot use fragments (hash) in memory history." ) ;
56
56
}
57
57
}
0 commit comments