Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "Core library for Verifiable Credentials and Decentralized Identif
repository = "https://github.com/spruceid/ssi/"
documentation = "https://docs.rs/ssi/"
keywords = ["ssi", "did", "vc", "vp", "jsonld"]
rust-version = "1.82"
rust-version = "1.87"

[workspace]
members = [
Expand Down
8 changes: 4 additions & 4 deletions crates/caips/src/caip10.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ impl<V: Vocabulary, I: Interpretation> linked_data::LinkedDataResource<I, V>
for BlockchainAccountId
{
fn interpretation(
&self,
&'_ self,
_vocabulary: &mut V,
_interpretation: &mut I,
) -> linked_data::ResourceInterpretation<I, V> {
) -> linked_data::ResourceInterpretation<'_, I, V> {
use linked_data::{rdf_types::Term, CowRdfTerm, RdfLiteral, ResourceInterpretation};
ResourceInterpretation::Uninterpreted(Some(CowRdfTerm::Owned(Term::Literal(
RdfLiteral::Xsd(xsd_types::Value::String(self.to_string())),
Expand Down Expand Up @@ -406,10 +406,10 @@ impl<V: Vocabulary, I: Interpretation, T> linked_data::LinkedDataResource<I, V>
for TypedBlockchainAccountId<T>
{
fn interpretation(
&self,
&'_ self,
_vocabulary: &mut V,
_interpretation: &mut I,
) -> linked_data::ResourceInterpretation<I, V> {
) -> linked_data::ResourceInterpretation<'_, I, V> {
use linked_data::{rdf_types::Term, CowRdfTerm, RdfLiteral, ResourceInterpretation};
ResourceInterpretation::Uninterpreted(Some(CowRdfTerm::Owned(Term::Literal(
RdfLiteral::Xsd(xsd_types::Value::String(self.to_string())),
Expand Down
2 changes: 1 addition & 1 deletion crates/claims/crates/cose/src/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn algorithm_name(algorithm: &Algorithm) -> String {
}

/// Returns the preferred signature algorithm for the give COSE key.
pub fn preferred_algorithm(key: &CoseKey) -> Option<Cow<Algorithm>> {
pub fn preferred_algorithm(key: &'_ CoseKey) -> Option<Cow<'_, Algorithm>> {
key.alg
.as_ref()
.map(Cow::Borrowed)
Expand Down
12 changes: 6 additions & 6 deletions crates/claims/crates/cose/src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ pub trait CoseKeyResolver {
/// Fetches the COSE key associated to the give identifier.
#[allow(async_fn_in_trait)]
async fn fetch_public_cose_key(
&self,
&'_ self,
id: Option<&[u8]>,
) -> Result<Cow<CoseKey>, ProofValidationError>;
) -> Result<Cow<'_, CoseKey>, ProofValidationError>;
}

impl<T: CoseKeyResolver> CoseKeyResolver for &T {
async fn fetch_public_cose_key(
&self,
&'_ self,
id: Option<&[u8]>,
) -> Result<Cow<CoseKey>, ProofValidationError> {
) -> Result<Cow<'_, CoseKey>, ProofValidationError> {
T::fetch_public_cose_key(*self, id).await
}
}

impl CoseKeyResolver for CoseKey {
async fn fetch_public_cose_key(
&self,
&'_ self,
_id: Option<&[u8]>,
) -> Result<Cow<CoseKey>, ProofValidationError> {
) -> Result<Cow<'_, CoseKey>, ProofValidationError> {
Ok(Cow::Borrowed(self))
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/claims/crates/cose/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub use sign1::*;
/// "application/json+cose".to_owned(),
/// ))
/// }
///
///
/// fn content_type(&self) -> Option<ContentType> {
/// Some(ContentType::Text("application/json".to_owned()))
/// }
Expand All @@ -136,7 +136,7 @@ pub trait CosePayload {
/// Payload bytes.
///
/// Returns the payload bytes representing this value.
fn payload_bytes(&self) -> Cow<[u8]>;
fn payload_bytes(&'_ self) -> Cow<'_, [u8]>;

/// Sign the payload to produce a serialized `COSE_Sign1` object.
///
Expand All @@ -153,7 +153,7 @@ pub trait CosePayload {
}

impl CosePayload for [u8] {
fn payload_bytes(&self) -> Cow<[u8]> {
fn payload_bytes(&'_ self) -> Cow<'_, [u8]> {
Cow::Borrowed(self)
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/claims/crates/data-integrity/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ssi-data-integrity-core"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
authors = ["Spruce Systems, Inc."]
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions crates/claims/crates/data-integrity/core/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ impl ssi_json_ld::Expandable for DataIntegrityDocument {
}

impl JsonLdObject for DataIntegrityDocument {
fn json_ld_context(&self) -> Option<Cow<ssi_json_ld::syntax::Context>> {
fn json_ld_context(&'_ self) -> Option<Cow<'_, ssi_json_ld::syntax::Context>> {
self.context.as_ref().map(Cow::Borrowed)
}
}

impl JsonLdNodeObject for DataIntegrityDocument {
fn json_ld_type(&self) -> ssi_json_ld::JsonLdTypes {
fn json_ld_type(&'_ self) -> ssi_json_ld::JsonLdTypes<'_> {
ssi_json_ld::JsonLdTypes::new(&[], Cow::Borrowed(self.types.as_slice()))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ pub struct EmbeddedProofConfigurationRef<'d, 'a, S: CryptographicSuite> {
}

impl<S: CryptographicSuite> JsonLdObject for EmbeddedProofConfigurationRef<'_, '_, S> {
fn json_ld_context(&self) -> Option<Cow<ssi_json_ld::syntax::Context>> {
fn json_ld_context(&'_ self) -> Option<Cow<'_, ssi_json_ld::syntax::Context>> {
self.context.as_deref().map(Cow::Borrowed)
}
}

impl<S: CryptographicSuite> JsonLdNodeObject for EmbeddedProofConfigurationRef<'_, '_, S> {
fn json_ld_type(&self) -> JsonLdTypes {
fn json_ld_type(&'_ self) -> JsonLdTypes<'_> {
self.type_.reborrow()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl<S: CryptographicSuite> ProofConfiguration<S> {
}
}

pub fn borrowed(&self) -> ProofConfigurationRef<S> {
pub fn borrowed(&'_ self) -> ProofConfigurationRef<'_, S> {
ProofConfigurationRef {
context: self.context.as_ref(),
type_: &self.type_,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use serde::{
use ssi_core::de::WithType;
use std::{collections::BTreeMap, marker::PhantomData};

use super::{Field, RefOrValue, ReplayMap, TypeField};
use super::{Field, FlatMapDeserializer, RefOrValue, ReplayMap, TypeField};

impl<'de, T: DeserializeCryptographicSuite<'de>> ProofConfiguration<T> {
fn deserialize_with_type<S>(type_: Type, mut deserializer: S) -> Result<Self, S::Error>
Expand Down Expand Up @@ -53,10 +53,7 @@ impl<'de, T: DeserializeCryptographicSuite<'de>> ProofConfiguration<T> {
}

let options = WithType::<T, OptionsOf<T>>::new(&suite)
.deserialize(serde::__private::de::FlatMapDeserializer(
&mut other,
PhantomData,
))?
.deserialize(FlatMapDeserializer::new(&mut other))?
.0;

Ok(Self {
Expand All @@ -73,10 +70,7 @@ impl<'de, T: DeserializeCryptographicSuite<'de>> ProofConfiguration<T> {
challenge,
nonce,
options,
extra_properties: BTreeMap::deserialize(serde::__private::de::FlatMapDeserializer(
&mut other,
PhantomData,
))?,
extra_properties: BTreeMap::deserialize(FlatMapDeserializer::new(&mut other))?,
})
}
}
Expand Down
Loading
Loading