Skip to content

Commit

Permalink
Use json-ld 0.19 (and fix clippy warnings).
Browse files Browse the repository at this point in the history
  • Loading branch information
timothee-haudebourg committed Jun 25, 2024
1 parent c5608c2 commit 7af98e7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/claims/crates/jws/src/compact/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl CompactJWSStr {

pub fn from_string(data: &str) -> Result<&Self, InvalidCompactJWS<&str>> {
let inner = CompactJWS::new(data.as_bytes()).map_err(|_| InvalidCompactJWS(data))?;
Ok(unsafe { std::mem::transmute(inner) })
Ok(unsafe { std::mem::transmute::<&CompactJWS, &Self>(inner) })
}

/// Creates a new compact JWS without checking the data.
Expand Down
2 changes: 1 addition & 1 deletion crates/dids/core/src/did.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl DID {
Ok(()) => Ok(unsafe {
// SAFETY: DID is a transparent wrapper over `[u8]`,
// and we just checked that `data` is a DID.
std::mem::transmute(bytes)
std::mem::transmute::<&[u8], &Self>(bytes)
}),
Err(e) => Err(InvalidDID(data, e)),
}
Expand Down
4 changes: 2 additions & 2 deletions crates/dids/core/src/did/url.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use core::fmt;
use std::{borrow::Borrow, ops::Deref, str::FromStr, usize};
use std::{borrow::Borrow, ops::Deref, str::FromStr};

use crate::DIDBuf;

Expand Down Expand Up @@ -41,7 +41,7 @@ impl DIDURL {
Ok(()) => Ok(unsafe {
// SAFETY: DID is a transparent wrapper over `[u8]`,
// and we just checked that `data` is a DID URL.
std::mem::transmute(data)
std::mem::transmute::<&[u8], &Self>(data)
}),
Err(e) => Err(InvalidDIDURL(data, e)),
}
Expand Down
4 changes: 2 additions & 2 deletions crates/dids/core/src/did/url/relative.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use core::fmt;
use std::{ops::Deref, usize};
use std::ops::Deref;

use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -34,7 +34,7 @@ impl RelativeDIDURL {
// SAFETY: DID is a transparent wrapper over `[u8]`,
// and we just checked that `data` is a relative DID
// URL.
std::mem::transmute(data)
std::mem::transmute::<&[u8], &Self>(data)
}),
Err(e) => Err(InvalidRelativeDIDURL(data, e)),
}
Expand Down
2 changes: 1 addition & 1 deletion crates/json-ld/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ documentation = "https://docs.rs/ssi-json-ld/"
[dependencies]
thiserror.workspace = true
async-std = { version = "1.9", features = ["attributes"] }
json-ld = { git = "https://github.com/timothee-haudebourg/json-ld", branch = "const-loader-without-generics", features = ["serde"]}
json-ld = { version = "0.19", features = ["serde"] }
iref.workspace = true
static-iref.workspace = true
rdf-types.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/multicodec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl MultiEncoded {
#[inline(always)]
pub fn new(bytes: &[u8]) -> Result<&Self, Error> {
unsigned_varint::decode::u64(bytes)?;
Ok(unsafe { std::mem::transmute(bytes) })
Ok(unsafe { std::mem::transmute::<&[u8], &Self>(bytes) })
}

/// Creates a new multi-encoded slice from the given `bytes` without
Expand Down

0 comments on commit 7af98e7

Please sign in to comment.