From 66f7b795d6b30d94a1316fcea00cbbcfc9acd5cd Mon Sep 17 00:00:00 2001 From: umr1352 Date: Wed, 11 Dec 2024 18:30:54 +0100 Subject: [PATCH] make clippy happy --- Cargo.toml | 2 - compound_resolver/Cargo.toml | 21 --- compound_resolver/src/lib.rs | 162 ------------------ identity_core/Cargo.toml | 1 - identity_credential/Cargo.toml | 1 - .../src/credential/jwt_serialization.rs | 2 +- .../domain_linkage_validator.rs | 1 - .../src/presentation/jwt_serialization.rs | 2 +- .../src/revocation/status_list_2021/entry.rs | 2 +- .../revocation_timeframe_status.rs | 2 +- .../src/sd_jwt_vc/metadata/claim.rs | 14 +- .../src/sd_jwt_vc/metadata/vc_type.rs | 6 +- identity_credential/src/sd_jwt_vc/token.rs | 6 +- identity_document/Cargo.toml | 1 - .../src/document/core_document.rs | 4 +- identity_document/src/utils/did_url_query.rs | 4 +- identity_ecdsa_verifier/Cargo.toml | 1 - identity_eddsa_verifier/Cargo.toml | 1 - identity_iota/Cargo.toml | 1 - identity_iota_core/Cargo.toml | 1 - .../src/document/iota_document.rs | 4 +- identity_jose/Cargo.toml | 1 - identity_jose/src/jws/decoder.rs | 2 +- identity_jose/src/jws/encoding/utils.rs | 4 +- identity_jose/src/jws/recipient.rs | 2 +- identity_resolver/Cargo.toml | 1 - identity_storage/Cargo.toml | 1 - identity_stronghold/Cargo.toml | 1 - identity_verification/Cargo.toml | 1 - 29 files changed, 26 insertions(+), 226 deletions(-) delete mode 100644 compound_resolver/Cargo.toml delete mode 100644 compound_resolver/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 6f35f6713f..6dc4d7dae2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,6 @@ members = [ "identity_ecdsa_verifier", "identity_eddsa_verifier", "examples", - "compound_resolver", ] exclude = ["bindings/wasm", "bindings/grpc"] @@ -35,7 +34,6 @@ edition = "2021" homepage = "https://www.iota.org" license = "Apache-2.0" repository = "https://github.com/iotaledger/identity.rs" -rust-version = "1.65" [workspace.lints.clippy] result_large_err = "allow" diff --git a/compound_resolver/Cargo.toml b/compound_resolver/Cargo.toml deleted file mode 100644 index 51c009c12c..0000000000 --- a/compound_resolver/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "compound_resolver" -version = "1.3.0" -authors.workspace = true -edition.workspace = true -homepage.workspace = true -license.workspace = true -repository.workspace = true -rust-version.workspace = true - -[dependencies] -itertools = "0.13.0" -proc-macro2 = "1.0.85" -quote = "1.0.36" -syn = { version = "2.0.66", features = ["full", "extra-traits"] } - -[lints] -workspace = true - -[lib] -proc-macro = true diff --git a/compound_resolver/src/lib.rs b/compound_resolver/src/lib.rs deleted file mode 100644 index a778c9141a..0000000000 --- a/compound_resolver/src/lib.rs +++ /dev/null @@ -1,162 +0,0 @@ -use itertools::Itertools; -use proc_macro::TokenStream; -use quote::quote; -use syn::parse::Parse; -use syn::punctuated::Punctuated; -use syn::Attribute; -use syn::Data; -use syn::DeriveInput; -use syn::Expr; -use syn::Field; -use syn::Ident; -use syn::Token; -use syn::Type; - -#[proc_macro_derive(CompoundResolver, attributes(resolver))] -pub fn derive_macro_compound_resolver(input: TokenStream) -> TokenStream { - let DeriveInput { - ident: struct_ident, - data, - generics, - .. - } = syn::parse_macro_input!(input); - - let Data::Struct(data) = data else { - panic!("Derive macro \"CompoundResolver\" only works on structs"); - }; - - data - .fields - .into_iter() - // parse all the fields that are annoted with #[resolver(..)] - .filter_map(ResolverField::from_field) - // Group together all resolvers with the same signature (input_ty, target_ty). - .flat_map(|ResolverField { ident, impls }| { - impls - .into_iter() - .map(move |ResolverImpl { input, target, pred }| ((input, target), (ident.clone(), pred))) - }) - .into_group_map() - .into_iter() - // generates code that forward the implementation of Resolver to field_name, if there's multiple fields - // implementing that trait, use `pred` to decide which one to call. - .map(|((input_ty, target_ty), impls)| { - let len = impls.len(); - let impl_block = gen_impl_block_multiple_resolvers(impls.into_iter(), len); - quote! { - impl ::identity_iota::resolver::Resolver<#input_ty> for #struct_ident #generics { - type Target = #target_ty; - async fn resolve(&self, input: &#input_ty) -> std::result::Result { - #impl_block - } - } - } - }) - .collect::() - .into() -} - -fn gen_impl_block_single_resolver(field_name: Ident) -> proc_macro2::TokenStream { - quote! { - self.#field_name.resolve(input).await - } -} - -fn gen_impl_block_single_resolver_with_pred(field_name: Ident, pred: Expr) -> proc_macro2::TokenStream { - let invocation_block = gen_impl_block_single_resolver(field_name); - quote! { - if #pred { return #invocation_block } - } -} - -fn gen_impl_block_multiple_resolvers( - impls: impl Iterator)>, - len: usize, -) -> proc_macro2::TokenStream { - impls - .enumerate() - .map(|(i, (field_name, pred))| { - if let Some(pred) = pred { - gen_impl_block_single_resolver_with_pred(field_name, pred) - } else if i == len - 1 { - gen_impl_block_single_resolver(field_name) - } else { - panic!("Multiple resolvers with the same signature. Expected predicate"); - } - }) - .collect() -} - -/// A field annotated with `#[resolver(Input -> Target, ..)]` -struct ResolverField { - ident: Ident, - impls: Vec, -} - -impl ResolverField { - pub fn from_field(field: Field) -> Option { - let Field { attrs, ident, .. } = field; - let Some(ident) = ident else { - panic!("Derive macro \"CompoundResolver\" only works on struct with named fields"); - }; - - let impls = attrs - .into_iter() - .flat_map(|attr| parse_resolver_attribute(attr).into_iter()) - .collect::>(); - - if !impls.is_empty() { - Some(ResolverField { ident, impls }) - } else { - None - } - } -} - -fn parse_resolver_attribute(attr: Attribute) -> Vec { - if attr.path().is_ident("resolver") { - attr - .parse_args_with(Punctuated::::parse_terminated) - .expect("invalid resolver annotation") - .into_iter() - .collect() - } else { - vec![] - } -} - -struct ResolverImpl { - pub input: Type, - pub target: Type, - pub pred: Option, -} - -impl Parse for ResolverImpl { - fn parse(input: syn::parse::ParseStream) -> syn::Result { - let input_ty = input.parse::()?; - let _ = input.parse::]>()?; - let target_ty = input.parse::()?; - let pred = if input.peek(Token![if]) { - let _ = input.parse::()?; - Some(input.parse::()?) - } else { - None - }; - - Ok({ - ResolverImpl { - input: input_ty, - target: target_ty, - pred, - } - }) - } -} - -#[test] -fn test_parse_resolver_attribute() { - syn::parse_str::("DidKey -> CoreDoc").unwrap(); - syn::parse_str::("DidKey -> Vec").unwrap(); - syn::parse_str::("Vec -> &str").unwrap(); - syn::parse_str::("DidIota -> IotaDoc if input.method_id() == \"iota\"").unwrap(); -} diff --git a/identity_core/Cargo.toml b/identity_core/Cargo.toml index fcdd263cc7..619745cb85 100644 --- a/identity_core/Cargo.toml +++ b/identity_core/Cargo.toml @@ -8,7 +8,6 @@ keywords = ["iota", "tangle", "identity"] license.workspace = true readme = "./README.md" repository.workspace = true -rust-version.workspace = true description = "The core traits and types for the identity-rs library." [dependencies] diff --git a/identity_credential/Cargo.toml b/identity_credential/Cargo.toml index 8aae0a2c2c..7372290a8b 100644 --- a/identity_credential/Cargo.toml +++ b/identity_credential/Cargo.toml @@ -8,7 +8,6 @@ keywords = ["iota", "tangle", "identity"] license.workspace = true readme = "./README.md" repository.workspace = true -rust-version.workspace = true description = "An implementation of the Verifiable Credentials standard." [dependencies] diff --git a/identity_credential/src/credential/jwt_serialization.rs b/identity_credential/src/credential/jwt_serialization.rs index 3f2a33f0a7..a92eb78ce8 100644 --- a/identity_credential/src/credential/jwt_serialization.rs +++ b/identity_credential/src/credential/jwt_serialization.rs @@ -118,7 +118,7 @@ where } #[cfg(feature = "validator")] -impl<'credential, T> CredentialJwtClaims<'credential, T> +impl CredentialJwtClaims<'_, T> where T: ToOwned + Serialize + DeserializeOwned, { diff --git a/identity_credential/src/domain_linkage/domain_linkage_validator.rs b/identity_credential/src/domain_linkage/domain_linkage_validator.rs index be67c96832..746a9b2f5a 100644 --- a/identity_credential/src/domain_linkage/domain_linkage_validator.rs +++ b/identity_credential/src/domain_linkage/domain_linkage_validator.rs @@ -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 { validator: JwtCredentialValidator, } diff --git a/identity_credential/src/presentation/jwt_serialization.rs b/identity_credential/src/presentation/jwt_serialization.rs index d8bb18c238..50aab3d428 100644 --- a/identity_credential/src/presentation/jwt_serialization.rs +++ b/identity_credential/src/presentation/jwt_serialization.rs @@ -136,7 +136,7 @@ where } #[cfg(feature = "validator")] -impl<'presentation, CRED, T> PresentationJwtClaims<'presentation, CRED, T> +impl PresentationJwtClaims<'_, CRED, T> where CRED: ToOwned + Serialize + DeserializeOwned + Clone, T: ToOwned + Serialize + DeserializeOwned, diff --git a/identity_credential/src/revocation/status_list_2021/entry.rs b/identity_credential/src/revocation/status_list_2021/entry.rs index 92415d06b7..1108b5e7c1 100644 --- a/identity_credential/src/revocation/status_list_2021/entry.rs +++ b/identity_credential/src/revocation/status_list_2021/entry.rs @@ -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) diff --git a/identity_credential/src/revocation/validity_timeframe_2024/revocation_timeframe_status.rs b/identity_credential/src/revocation/validity_timeframe_2024/revocation_timeframe_status.rs index 0a70589112..6ae6ea74f8 100644 --- a/identity_credential/src/revocation/validity_timeframe_2024/revocation_timeframe_status.rs +++ b/identity_credential/src/revocation/validity_timeframe_2024/revocation_timeframe_status.rs @@ -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) diff --git a/identity_credential/src/sd_jwt_vc/metadata/claim.rs b/identity_credential/src/sd_jwt_vc/metadata/claim.rs index 28a0b0faef..8dcfdde0c1 100644 --- a/identity_credential/src/sd_jwt_vc/metadata/claim.rs +++ b/identity_credential/src/sd_jwt_vc/metadata/claim.rs @@ -231,13 +231,11 @@ fn index_value<'v>(value: &'v Value, segment: &ClaimPathSegment) -> anyhow::Resu #[cfg(test)] mod tests { - use std::cell::LazyCell; - use serde_json::json; use super::*; - const SAMPLE_OBJ: LazyCell = LazyCell::new(|| { + fn sample_obj() -> Value { json!({ "vct": "https://betelgeuse.example.com/education_credential", "name": "Arthur Dent", @@ -258,7 +256,7 @@ mod tests { ], "nationalities": ["British", "Betelgeusian"] }) - }); + } #[test] fn claim_path_works() { @@ -268,18 +266,18 @@ mod tests { let degrees_types_path = serde_json::from_value::(json!(["degrees", null, "type"])).unwrap(); assert!(matches!( - name_path.reverse_index(&SAMPLE_OBJ).unwrap(), + name_path.reverse_index(&sample_obj()).unwrap(), OneOrManyValue::One(&Value::String(_)) )); assert!(matches!( - city_path.reverse_index(&SAMPLE_OBJ).unwrap(), + city_path.reverse_index(&sample_obj()).unwrap(), OneOrManyValue::One(&Value::String(_)) )); assert!(matches!( - first_degree_path.reverse_index(&SAMPLE_OBJ).unwrap(), + first_degree_path.reverse_index(&sample_obj()).unwrap(), OneOrManyValue::One(&Value::Object(_)) )); - let obj = &*SAMPLE_OBJ; + let obj = &sample_obj(); let mut degree_types = degrees_types_path.reverse_index(obj).unwrap().into_iter(); assert_eq!(degree_types.next().unwrap().as_str(), Some("Bachelor of Science")); assert_eq!(degree_types.next().unwrap().as_str(), Some("Master of Science")); diff --git a/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs b/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs index 9cb07d9cc3..ad4ae5e0e9 100644 --- a/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs +++ b/identity_credential/src/sd_jwt_vc/metadata/vc_type.rs @@ -185,7 +185,7 @@ pub enum TypeSchema { #[cfg(test)] mod tests { - use std::cell::LazyCell; + use std::sync::LazyLock; use async_trait::async_trait; use serde_json::json; @@ -194,7 +194,7 @@ mod tests { use super::*; - const IMMEDIATE_TYPE_METADATA: LazyCell = LazyCell::new(|| TypeMetadata { + static IMMEDIATE_TYPE_METADATA: LazyLock = LazyLock::new(|| TypeMetadata { name: Some("immediate credential".to_string()), description: None, extends: None, @@ -218,7 +218,7 @@ mod tests { schema_integrity: None, }), }); - const REFERENCED_TYPE_METADATA: LazyCell = LazyCell::new(|| TypeMetadata { + static REFERENCED_TYPE_METADATA: LazyLock = LazyLock::new(|| TypeMetadata { name: Some("immediate credential".to_string()), description: None, extends: None, diff --git a/identity_credential/src/sd_jwt_vc/token.rs b/identity_credential/src/sd_jwt_vc/token.rs index e898fd6ac9..f2635c7f7a 100644 --- a/identity_credential/src/sd_jwt_vc/token.rs +++ b/identity_credential/src/sd_jwt_vc/token.rs @@ -443,7 +443,7 @@ impl From for SdJwt { #[cfg(test)] mod tests { - use std::cell::LazyCell; + use std::sync::LazyLock; use identity_core::common::StringOrUrl; use identity_core::common::Url; @@ -451,8 +451,8 @@ mod tests { use super::*; const EXAMPLE_SD_JWT_VC: &str = "eyJhbGciOiAiRVMyNTYiLCAidHlwIjogInZjK3NkLWp3dCJ9.eyJfc2QiOiBbIjBIWm1uU0lQejMzN2tTV2U3QzM0bC0tODhnekppLWVCSjJWel9ISndBVGciLCAiOVpicGxDN1RkRVc3cWFsNkJCWmxNdHFKZG1lRU9pWGV2ZEpsb1hWSmRSUSIsICJJMDBmY0ZVb0RYQ3VjcDV5eTJ1anFQc3NEVkdhV05pVWxpTnpfYXdEMGdjIiwgIklFQllTSkdOaFhJbHJRbzU4eWtYbTJaeDN5bGw5WmxUdFRvUG8xN1FRaVkiLCAiTGFpNklVNmQ3R1FhZ1hSN0F2R1RyblhnU2xkM3o4RUlnX2Z2M2ZPWjFXZyIsICJodkRYaHdtR2NKUXNCQ0EyT3RqdUxBY3dBTXBEc2FVMG5rb3ZjS09xV05FIiwgImlrdXVyOFE0azhxM1ZjeUE3ZEMtbU5qWkJrUmVEVFUtQ0c0bmlURTdPVFUiLCAicXZ6TkxqMnZoOW80U0VYT2ZNaVlEdXZUeWtkc1dDTmcwd1RkbHIwQUVJTSIsICJ3elcxNWJoQ2t2a3N4VnZ1SjhSRjN4aThpNjRsbjFqb183NkJDMm9hMXVnIiwgInpPZUJYaHh2SVM0WnptUWNMbHhLdUVBT0dHQnlqT3FhMXoySW9WeF9ZRFEiXSwgImlzcyI6ICJodHRwczovL2V4YW1wbGUuY29tL2lzc3VlciIsICJpYXQiOiAxNjgzMDAwMDAwLCAiZXhwIjogMTg4MzAwMDAwMCwgInZjdCI6ICJodHRwczovL2JtaS5idW5kLmV4YW1wbGUvY3JlZGVudGlhbC9waWQvMS4wIiwgImFnZV9lcXVhbF9vcl9vdmVyIjogeyJfc2QiOiBbIkZjOElfMDdMT2NnUHdyREpLUXlJR085N3dWc09wbE1Makh2UkM0UjQtV2ciLCAiWEx0TGphZFVXYzl6Tl85aE1KUm9xeTQ2VXNDS2IxSXNoWnV1cVVGS1NDQSIsICJhb0NDenNDN3A0cWhaSUFoX2lkUkNTQ2E2NDF1eWNuYzh6UGZOV3o4bngwIiwgImYxLVAwQTJkS1dhdnYxdUZuTVgyQTctRVh4dmhveHY1YUhodUVJTi1XNjQiLCAiazVoeTJyMDE4dnJzSmpvLVZqZDZnNnl0N0Fhb25Lb25uaXVKOXplbDNqbyIsICJxcDdaX0t5MVlpcDBzWWdETzN6VnVnMk1GdVBOakh4a3NCRG5KWjRhSS1jIl19LCAiX3NkX2FsZyI6ICJzaGEtMjU2IiwgImNuZiI6IHsiandrIjogeyJrdHkiOiAiRUMiLCAiY3J2IjogIlAtMjU2IiwgIngiOiAiVENBRVIxOVp2dTNPSEY0ajRXNHZmU1ZvSElQMUlMaWxEbHM3dkNlR2VtYyIsICJ5IjogIlp4amlXV2JaTVFHSFZXS1ZRNGhiU0lpcnNWZnVlY0NFNnQ0alQ5RjJIWlEifX19.CaXec2NNooWAy4eTxYbGWI--UeUL0jpC7Zb84PP_09Z655BYcXUTvfj6GPk4mrNqZUU5GT6QntYR8J9rvcBjvA~WyJuUHVvUW5rUkZxM0JJZUFtN0FuWEZBIiwgIm5hdGlvbmFsaXRpZXMiLCBbIkRFIl1d~WyJNMEpiNTd0NDF1YnJrU3V5ckRUM3hBIiwgIjE4IiwgdHJ1ZV0~eyJhbGciOiAiRVMyNTYiLCAidHlwIjogImtiK2p3dCJ9.eyJub25jZSI6ICIxMjM0NTY3ODkwIiwgImF1ZCI6ICJodHRwczovL2V4YW1wbGUuY29tL3ZlcmlmaWVyIiwgImlhdCI6IDE3MjA0NTQyOTUsICJzZF9oYXNoIjogIlZFejN0bEtqOVY0UzU3TTZoRWhvVjRIc19SdmpXZWgzVHN1OTFDbmxuZUkifQ.GqtiTKNe3O95GLpdxFK_2FZULFk6KUscFe7RPk8OeVLiJiHsGvtPyq89e_grBplvGmnDGHoy8JAt1wQqiwktSg"; - const EXAMPLE_ISSUER: LazyCell = LazyCell::new(|| "https://example.com/issuer".parse().unwrap()); - const EXAMPLE_VCT: LazyCell = LazyCell::new(|| { + static EXAMPLE_ISSUER: LazyLock = LazyLock::new(|| "https://example.com/issuer".parse().unwrap()); + static EXAMPLE_VCT: LazyLock = LazyLock::new(|| { "https://bmi.bund.example/credential/pid/1.0" .parse::() .unwrap() diff --git a/identity_document/Cargo.toml b/identity_document/Cargo.toml index 4bb50dd09d..cf212716ba 100644 --- a/identity_document/Cargo.toml +++ b/identity_document/Cargo.toml @@ -8,7 +8,6 @@ keywords = ["iota", "tangle", "identity", "did"] license.workspace = true readme = "./README.md" repository.workspace = true -rust-version.workspace = true description = "Method-agnostic implementation of the Decentralized Identifiers (DID) standard." [dependencies] diff --git a/identity_document/src/document/core_document.rs b/identity_document/src/document/core_document.rs index 2747f7fae6..1e1a340bb4 100644 --- a/identity_document/src/document/core_document.rs +++ b/identity_document/src/document/core_document.rs @@ -690,7 +690,7 @@ impl CoreDocument { &'me self, method_query: Q, scope: Option, - ) -> Option<&VerificationMethod> + ) -> Option<&'me VerificationMethod> where Q: Into>, { @@ -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 #. - 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>, { diff --git a/identity_document/src/utils/did_url_query.rs b/identity_document/src/utils/did_url_query.rs index 1af2b80b4c..d9399457e3 100644 --- a/identity_document/src/utils/did_url_query.rs +++ b/identity_document/src/utils/did_url_query.rs @@ -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. @@ -81,7 +81,7 @@ impl<'query> From<&'query DIDUrl> for DIDUrlQuery<'query> { } } -impl<'query> From for DIDUrlQuery<'query> { +impl From for DIDUrlQuery<'_> { fn from(other: DIDUrl) -> Self { Self(Cow::Owned(other.to_string())) } diff --git a/identity_ecdsa_verifier/Cargo.toml b/identity_ecdsa_verifier/Cargo.toml index 6829d41ae0..6c7e70a954 100644 --- a/identity_ecdsa_verifier/Cargo.toml +++ b/identity_ecdsa_verifier/Cargo.toml @@ -8,7 +8,6 @@ keywords = ["iota", "identity", "jose", "jwk", "jws"] license.workspace = true readme = "./README.md" repository.workspace = true -rust-version.workspace = true description = "JWS ECDSA signature verification for IOTA Identity" [lints] diff --git a/identity_eddsa_verifier/Cargo.toml b/identity_eddsa_verifier/Cargo.toml index b7da49295a..745f9b6b0d 100644 --- a/identity_eddsa_verifier/Cargo.toml +++ b/identity_eddsa_verifier/Cargo.toml @@ -8,7 +8,6 @@ keywords = ["iota", "identity", "jose", "jwk", "jws"] license.workspace = true readme = "./README.md" repository.workspace = true -rust-version.workspace = true description = "JWS EdDSA signature verification for IOTA Identity" [dependencies] diff --git a/identity_iota/Cargo.toml b/identity_iota/Cargo.toml index 6d1bf0a9a5..e77e68a151 100644 --- a/identity_iota/Cargo.toml +++ b/identity_iota/Cargo.toml @@ -8,7 +8,6 @@ keywords = ["iota", "tangle", "identity", "did", "ssi"] license.workspace = true readme = "./README.md" repository.workspace = true -rust-version.workspace = true description = "Framework for Self-Sovereign Identity with IOTA DID." [dependencies] diff --git a/identity_iota_core/Cargo.toml b/identity_iota_core/Cargo.toml index 73dcc4190e..0303e351a3 100644 --- a/identity_iota_core/Cargo.toml +++ b/identity_iota_core/Cargo.toml @@ -8,7 +8,6 @@ keywords = ["iota", "tangle", "utxo", "shimmer", "identity"] license.workspace = true readme = "./README.md" repository.workspace = true -rust-version.workspace = true description = "An IOTA Ledger integration for the IOTA DID Method." [dependencies] diff --git a/identity_iota_core/src/document/iota_document.rs b/identity_iota_core/src/document/iota_document.rs index bd3404045c..5c0813f28c 100644 --- a/identity_iota_core/src/document/iota_document.rs +++ b/identity_iota_core/src/document/iota_document.rs @@ -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 #. - 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>, { @@ -347,7 +347,7 @@ impl IotaDocument { &'me self, method_query: Q, scope: Option, - ) -> Option<&VerificationMethod> + ) -> Option<&'me VerificationMethod> where Q: Into>, { diff --git a/identity_jose/Cargo.toml b/identity_jose/Cargo.toml index 73a7fa3cdb..e5449c30a6 100644 --- a/identity_jose/Cargo.toml +++ b/identity_jose/Cargo.toml @@ -8,7 +8,6 @@ keywords = ["iota", "identity", "jose", "jwk", "jws"] license.workspace = true readme = "./README.md" repository.workspace = true -rust-version.workspace = true description = "A library for JOSE (JSON Object Signing and Encryption)" [dependencies] diff --git a/identity_jose/src/jws/decoder.rs b/identity_jose/src/jws/decoder.rs index 6b93488acf..c1635c86d3 100644 --- a/identity_jose/src/jws/decoder.rs +++ b/identity_jose/src/jws/decoder.rs @@ -322,7 +322,7 @@ pub struct JwsValidationIter<'decoder, 'payload, 'signatures> { payload: &'payload [u8], } -impl<'decoder, 'payload, 'signatures> Iterator for JwsValidationIter<'decoder, 'payload, 'signatures> { +impl<'payload> Iterator for JwsValidationIter<'_, 'payload, '_> { type Item = Result>; fn next(&mut self) -> Option { diff --git a/identity_jose/src/jws/encoding/utils.rs b/identity_jose/src/jws/encoding/utils.rs index b1d903e612..2be2703488 100644 --- a/identity_jose/src/jws/encoding/utils.rs +++ b/identity_jose/src/jws/encoding/utils.rs @@ -86,7 +86,7 @@ pub(super) struct Flatten<'payload, 'unprotected> { pub(super) signature: JwsSignature<'unprotected>, } -impl<'payload, 'unprotected> Flatten<'payload, 'unprotected> { +impl Flatten<'_, '_> { pub(super) fn to_json(&self) -> Result { serde_json::to_string(&self).map_err(Error::InvalidJson) } @@ -99,7 +99,7 @@ pub(super) struct General<'payload, 'unprotected> { pub(super) signatures: Vec>, } -impl<'payload, 'unprotected> General<'payload, 'unprotected> { +impl General<'_, '_> { pub(super) fn to_json(&self) -> Result { serde_json::to_string(&self).map_err(Error::InvalidJson) } diff --git a/identity_jose/src/jws/recipient.rs b/identity_jose/src/jws/recipient.rs index 602f1e6f3f..96dd410fa0 100644 --- a/identity_jose/src/jws/recipient.rs +++ b/identity_jose/src/jws/recipient.rs @@ -15,7 +15,7 @@ pub struct Recipient<'a> { pub unprotected: Option<&'a JwsHeader>, } -impl<'a> Default for Recipient<'a> { +impl Default for Recipient<'_> { fn default() -> Self { Self::new() } diff --git a/identity_resolver/Cargo.toml b/identity_resolver/Cargo.toml index d99158835d..fd8ffd7a0b 100644 --- a/identity_resolver/Cargo.toml +++ b/identity_resolver/Cargo.toml @@ -8,7 +8,6 @@ keywords = ["iota", "did", "identity", "resolver", "resolution"] license.workspace = true readme = "./README.md" repository.workspace = true -rust-version.workspace = true description = "DID Resolution utilities for the identity.rs library." [dependencies] diff --git a/identity_storage/Cargo.toml b/identity_storage/Cargo.toml index 5331dc725f..2e07548630 100644 --- a/identity_storage/Cargo.toml +++ b/identity_storage/Cargo.toml @@ -8,7 +8,6 @@ keywords = ["iota", "storage", "identity", "kms"] license.workspace = true readme = "./README.md" repository.workspace = true -rust-version.workspace = true description = "Abstractions over storage for cryptographic keys used in DID Documents" [dependencies] diff --git a/identity_stronghold/Cargo.toml b/identity_stronghold/Cargo.toml index b7c61a998f..693dfa271e 100644 --- a/identity_stronghold/Cargo.toml +++ b/identity_stronghold/Cargo.toml @@ -8,7 +8,6 @@ keywords = ["iota", "storage", "identity", "kms", "stronghold"] license.workspace = true readme = "./README.md" repository.workspace = true -rust-version.workspace = true description = "Secure JWK storage with Stronghold for IOTA Identity" [dependencies] diff --git a/identity_verification/Cargo.toml b/identity_verification/Cargo.toml index 46fcc5ac24..9c122cec93 100644 --- a/identity_verification/Cargo.toml +++ b/identity_verification/Cargo.toml @@ -6,7 +6,6 @@ edition.workspace = true homepage.workspace = true license.workspace = true repository.workspace = true -rust-version.workspace = true description = "Verification data types and functionality for identity.rs" [dependencies]