Skip to content

Commit e770bad

Browse files
committed
Add :: to types in the macro for safety
1 parent 9172700 commit e770bad

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

crates/bitwarden-uuid-macro/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ pub fn uuid(input: TokenStream) -> TokenStream {
1919
let expanded = quote! {
2020
#[cfg(feature = "wasm")]
2121
#[doc = #doc_string]
22-
#[derive(serde::Serialize, serde::Deserialize, tsify_next::Tsify)]
22+
#[derive(::serde::Serialize, ::serde::Deserialize, ::tsify_next::Tsify)]
2323
#[tsify(into_wasm_abi, from_wasm_abi)]
2424
#[repr(transparent)]
2525
#vis struct #ident(
2626
#[tsify(type = #tsify_type)]
27-
uuid::Uuid
27+
::uuid::Uuid
2828
);
2929

3030
#[cfg(not(feature = "wasm"))]
3131
#[doc = #doc_string]
32-
#[derive(serde::Serialize, serde::Deserialize)]
32+
#[derive(::serde::Serialize, ::serde::Deserialize)]
3333
#[repr(transparent)]
3434
#vis struct #ident(
35-
uuid::Uuid
35+
::uuid::Uuid
3636
);
3737

3838
#[cfg(feature = "uniffi")]
@@ -44,15 +44,15 @@ pub fn uuid(input: TokenStream) -> TokenStream {
4444
}
4545
}
4646

47-
impl std::str::FromStr for #ident {
47+
impl ::std::str::FromStr for #ident {
4848
type Err = uuid::Error;
4949

5050
fn from_str(s: &str) -> Result<Self, Self::Err> {
5151
uuid::Uuid::from_str(s).map(Self)
5252
}
5353
}
5454

55-
impl From<#ident> for uuid::Uuid {
55+
impl From<#ident> for ::uuid::Uuid {
5656
fn from(value: #ident) -> Self {
5757
value.0
5858
}

crates/bitwarden-vault/src/cipher/cipher_client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ mod tests {
218218
// Move cipher to organization
219219
let res = client.vault().ciphers().move_to_organization(
220220
view,
221-
OrganizationId("1bc9ac1e-f5aa-45f2-94bf-b181009709b8".parse().unwrap()),
221+
"1bc9ac1e-f5aa-45f2-94bf-b181009709b8".parse().unwrap(),
222222
);
223223

224224
assert!(res.is_err());
@@ -323,7 +323,7 @@ mod tests {
323323
.ciphers()
324324
.move_to_organization(
325325
view,
326-
OrganizationId("1bc9ac1e-f5aa-45f2-94bf-b181009709b8".parse().unwrap()),
326+
"1bc9ac1e-f5aa-45f2-94bf-b181009709b8".parse().unwrap(),
327327
)
328328
.unwrap();
329329
let EncryptionContext {

0 commit comments

Comments
 (0)