Skip to content

Commit

Permalink
cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
UMR1352 committed Jan 6, 2025
1 parent 6c44131 commit 1142fe4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion identity_credential/src/credential/jwt_serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ where
}

#[cfg(feature = "validator")]
impl<'credential, T> CredentialJwtClaims<'credential, T>
impl<T> CredentialJwtClaims<'_, T>
where
T: ToOwned<Owned = T> + Serialize + DeserializeOwned,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use super::DomainLinkageValidationResult;
use crate::utils::url_only_includes_origin;

/// A validator for a Domain Linkage Configuration and Credentials.
pub struct JwtDomainLinkageValidator<V: JwsVerifier> {
validator: JwtCredentialValidator<V>,
}
Expand Down
2 changes: 1 addition & 1 deletion identity_credential/src/presentation/jwt_serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ where
}

#[cfg(feature = "validator")]
impl<'presentation, CRED, T> PresentationJwtClaims<'presentation, CRED, T>
impl<CRED, T> PresentationJwtClaims<'_, CRED, T>
where
CRED: ToOwned<Owned = CRED> + Serialize + DeserializeOwned + Clone,
T: ToOwned<Owned = T> + Serialize + DeserializeOwned,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ where
D: serde::Deserializer<'de>,
{
struct ExactStrVisitor(&'static str);
impl<'a> Visitor<'a> for ExactStrVisitor {
impl Visitor<'_> for ExactStrVisitor {
type Value = &'static str;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "the exact string \"{}\"", self.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ where
D: serde::Deserializer<'de>,
{
struct ExactStrVisitor(&'static str);
impl<'a> Visitor<'a> for ExactStrVisitor {
impl Visitor<'_> for ExactStrVisitor {
type Value = &'static str;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "the exact string \"{}\"", self.0)
Expand Down
4 changes: 2 additions & 2 deletions identity_document/src/document/core_document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ impl CoreDocument {
&'me self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&VerificationMethod>
) -> Option<&'me VerificationMethod>
where
Q: Into<DIDUrlQuery<'query>>,
{
Expand Down Expand Up @@ -773,7 +773,7 @@ impl CoreDocument {
/// Returns the first [`Service`] with an `id` property matching the provided `service_query`, if present.
// NOTE: This method demonstrates unexpected behavior in the edge cases where the document contains
// services whose ids are of the form <did different from this document's>#<fragment>.
pub fn resolve_service<'query, 'me, Q>(&'me self, service_query: Q) -> Option<&Service>
pub fn resolve_service<'query, 'me, Q>(&'me self, service_query: Q) -> Option<&'me Service>
where
Q: Into<DIDUrlQuery<'query>>,
{
Expand Down
4 changes: 2 additions & 2 deletions identity_document/src/utils/did_url_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use identity_did::DID;
#[repr(transparent)]
pub struct DIDUrlQuery<'query>(Cow<'query, str>);

impl<'query> DIDUrlQuery<'query> {
impl DIDUrlQuery<'_> {
/// Returns whether this query matches the given DIDUrl.
pub(crate) fn matches(&self, did_url: &DIDUrl) -> bool {
// Ensure the DID matches if included in the query.
Expand Down Expand Up @@ -81,7 +81,7 @@ impl<'query> From<&'query DIDUrl> for DIDUrlQuery<'query> {
}
}

impl<'query> From<DIDUrl> for DIDUrlQuery<'query> {
impl From<DIDUrl> for DIDUrlQuery<'_> {
fn from(other: DIDUrl) -> Self {
Self(Cow::Owned(other.to_string()))
}
Expand Down
4 changes: 2 additions & 2 deletions identity_iota_core/src/document/iota_document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ impl IotaDocument {
/// Returns the first [`Service`] with an `id` property matching the provided `service_query`, if present.
// NOTE: This method demonstrates unexpected behaviour in the edge cases where the document contains
// services whose ids are of the form <did different from this document's>#<fragment>.
pub fn resolve_service<'query, 'me, Q>(&'me self, service_query: Q) -> Option<&Service>
pub fn resolve_service<'query, 'me, Q>(&'me self, service_query: Q) -> Option<&'me Service>
where
Q: Into<DIDUrlQuery<'query>>,
{
Expand All @@ -347,7 +347,7 @@ impl IotaDocument {
&'me self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&VerificationMethod>
) -> Option<&'me VerificationMethod>
where
Q: Into<DIDUrlQuery<'query>>,
{
Expand Down

0 comments on commit 1142fe4

Please sign in to comment.