File tree Expand file tree Collapse file tree 3 files changed +24
-4
lines changed
bitwarden-uniffi/src/vault
bitwarden-vault/src/cipher Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ impl CiphersClient {
41
41
) -> Result < CipherView > {
42
42
Ok ( self
43
43
. 0
44
- . move_to_organization ( cipher, OrganizationId ( organization_id) )
44
+ . move_to_organization ( cipher, OrganizationId :: new ( organization_id) )
45
45
. map_err ( Error :: Cipher ) ?)
46
46
}
47
47
}
Original file line number Diff line number Diff line change @@ -22,18 +22,38 @@ pub fn uuid(input: TokenStream) -> TokenStream {
22
22
#[ repr( transparent) ]
23
23
#vis struct #ident(
24
24
#[ tsify( type = #tsify_type) ]
25
- pub uuid:: Uuid
25
+ uuid:: Uuid
26
26
) ;
27
27
28
28
#[ cfg( not( feature = "wasm" ) ) ]
29
29
#[ derive( serde:: Serialize , serde:: Deserialize ) ]
30
30
#[ repr( transparent) ]
31
31
#vis struct #ident(
32
- pub uuid:: Uuid
32
+ uuid:: Uuid
33
33
) ;
34
34
35
35
#[ cfg( feature = "uniffi" ) ]
36
36
uniffi:: custom_newtype!( #ident, uuid:: Uuid ) ;
37
+
38
+ impl #ident {
39
+ pub fn new( value: uuid:: Uuid ) -> Self {
40
+ Self ( value)
41
+ }
42
+ }
43
+
44
+ impl std:: str :: FromStr for #ident {
45
+ type Err = uuid:: Error ;
46
+
47
+ fn from_str( s: & str ) -> Result <Self , Self :: Err > {
48
+ uuid:: Uuid :: from_str( s) . map( Self )
49
+ }
50
+ }
51
+
52
+ impl From <#ident> for uuid:: Uuid {
53
+ fn from( value: #ident) -> Self {
54
+ value. 0
55
+ }
56
+ }
37
57
} ;
38
58
39
59
TokenStream :: from ( expanded)
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ impl CiphersClient {
64
64
organization_id : OrganizationId ,
65
65
) -> Result < CipherView , CipherError > {
66
66
let key_store = self . client . internal . get_key_store ( ) ;
67
- cipher_view. move_to_organization ( & mut key_store. context ( ) , organization_id. 0 ) ?;
67
+ cipher_view. move_to_organization ( & mut key_store. context ( ) , organization_id. into ( ) ) ?;
68
68
Ok ( cipher_view)
69
69
}
70
70
You can’t perform that action at this time.
0 commit comments