diff --git a/Cargo.toml b/Cargo.toml index 8502aa41f3..f2b1ea8cea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,8 +50,8 @@ panic = 'unwind' incremental = false [workspace.lints.clippy] -all = "warn" -pedantic = "warn" +all = { level = "warn", priority = -1 } +pedantic = { level = "warn", priority = -1 } struct_excessive_bools = "allow" trivially_copy_pass_by_ref = "allow" must_use_candidate = "allow" @@ -66,8 +66,6 @@ missing_copy_implementations = "warn" missing_debug_implementations = "warn" non_ascii_idents = "warn" pointer_structural_match = "warn" -rust_2018_idioms = "warn" -rust_2021_compatibility = "warn" trivial_casts = "warn" trivial_numeric_casts = "warn" unused_extern_crates = "warn" @@ -93,15 +91,15 @@ bs58 = "0.5.1" multibase = "0.9.1" hex = "0.4.3" pem = "3.0.4" -serde = "1.0.217" +serde = { version = "1.0.217", default-features = false } serde_json = "1.0.134" derive_more = "1.0.0" async-trait = "0.1.83" -futures = "0.3.31" +futures = { version = "0.3.31", default-features = false } log = "0.4.22" -url = "2.5.4" -uuid = "1.11.0" -chrono = "0.4.39" +url = { version = "2.5.4", default-features = false } +uuid = { version = "1.11.0", default-features = false, features = ["v4"] } +chrono = { version = "0.4.39", default-features = false } typed-builder = "0.20.0" thiserror = "2.0.9" anyhow = "1.0.95" @@ -119,7 +117,7 @@ syn = "2.0.93" quote = "1.0.38" # common drivers -tokio = "1.42.0" +tokio = { version = "1.42.0", default-features = false } sqlx = "0.8.2" reqwest = "0.12.11" axum = "0.7.9" @@ -137,7 +135,5 @@ uniffi = "0.23.0" # TODO - await new indy-vdr release [patch.'https://github.com/hyperledger/indy-vdr'] -indy-vdr = { git = "https://github.com/anonyome/indy-vdr.git", rev = "34ada55", default-features = false, features = [ - "log", -] } +indy-vdr = { git = "https://github.com/anonyome/indy-vdr.git", rev = "34ada55" } indy-vdr-proxy-client = { git = "https://github.com/anonyome/indy-vdr.git", rev = "34ada55" } \ No newline at end of file diff --git a/aries/agents/aath-backchannel/Cargo.toml b/aries/agents/aath-backchannel/Cargo.toml index 48bd27050a..36a095c272 100644 --- a/aries/agents/aath-backchannel/Cargo.toml +++ b/aries/agents/aath-backchannel/Cargo.toml @@ -23,7 +23,7 @@ serde.workspace = true serde_json.workspace = true log.workspace = true env_logger.workspace = true -uuid = { workspace = true, features = ["serde", "v4"] } +uuid = { workspace = true, features = ["serde"] } aries-vcx-agent = { path = "../../../aries/agents/aries-vcx-agent" } anoncreds_types = { path = "../../../aries/misc/anoncreds_types" } display_as_json = { path = "../../../misc/display_as_json" } diff --git a/aries/agents/mediator/client-tui/Cargo.toml b/aries/agents/mediator/client-tui/Cargo.toml index fb6fec6fb3..6cceffad68 100644 --- a/aries/agents/mediator/client-tui/Cargo.toml +++ b/aries/agents/mediator/client-tui/Cargo.toml @@ -11,7 +11,7 @@ aries_vcx_wallet = { path = "../../../aries_vcx_wallet", features = [ ] } axum.workspace = true cursive = { version = "0.20.0", features = ["crossterm-backend"] } -futures.workspace = true +futures = { workspace = true, default-features = true } log.workspace = true mediator = { path = ".." } messages = { path = "../../../messages" } diff --git a/aries/agents/mediator/src/persistence/errors.rs b/aries/agents/mediator/src/persistence/errors.rs index ee43a448ec..38bd269f02 100644 --- a/aries/agents/mediator/src/persistence/errors.rs +++ b/aries/agents/mediator/src/persistence/errors.rs @@ -23,7 +23,6 @@ pub struct DecodeError(#[from] pub Box); /// with the help of thiserror. /// Usage: /// errorset!(ComposedError\[ErrorVariant1, ErrorVariant2\]); - macro_rules! error_compose { ($errorset_name:ident[$($error_name: ident),*]) => { #[derive(Error, Debug)] diff --git a/aries/aries_vcx/Cargo.toml b/aries/aries_vcx/Cargo.toml index 4f4ff82a85..7f1cf2b5fb 100644 --- a/aries/aries_vcx/Cargo.toml +++ b/aries/aries_vcx/Cargo.toml @@ -55,7 +55,7 @@ base64.workspace = true sha2.workspace = true num-bigint = "0.4.5" futures = { workspace = true, default-features = false } -uuid = { workspace = true, default-features = false, features = ["v4"] } +uuid = { workspace = true } strum.workspace = true strum_macros.workspace = true derive_builder = "0.20.0" diff --git a/aries/aries_vcx/src/common/proofs/verifier/verifier_internal.rs b/aries/aries_vcx/src/common/proofs/verifier/verifier_internal.rs index bcd7fd31b6..0c6e137cf8 100644 --- a/aries/aries_vcx/src/common/proofs/verifier/verifier_internal.rs +++ b/aries/aries_vcx/src/common/proofs/verifier/verifier_internal.rs @@ -128,7 +128,7 @@ pub async fn build_schemas_json_verifier( let mut schemas_json = json!({}); for cred_info in credential_data.iter() { - if schemas_json.get(&cred_info.schema_id.to_string()).is_none() { + if schemas_json.get(cred_info.schema_id.to_string()).is_none() { let schema_id = &cred_info.schema_id; let schema_json = ledger.get_schema(schema_id, None).await.map_err(|_err| { AriesVcxError::from_msg(AriesVcxErrorKind::InvalidSchema, "Cannot get schema") diff --git a/aries/aries_vcx_anoncreds/Cargo.toml b/aries/aries_vcx_anoncreds/Cargo.toml index 5c5a59f6f1..9f29b5b91d 100644 --- a/aries/aries_vcx_anoncreds/Cargo.toml +++ b/aries/aries_vcx_anoncreds/Cargo.toml @@ -19,7 +19,7 @@ did_parser_nom = { path = "../../did_core/did_parser_nom" } async-trait.workspace = true thiserror.workspace = true log.workspace = true -uuid = { workspace = true, default-features = false, features = ["v4"] } +uuid = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json.workspace = true time.workspace = true diff --git a/aries/aries_vcx_ledger/Cargo.toml b/aries/aries_vcx_ledger/Cargo.toml index 4015f7d72c..adbe8031eb 100644 --- a/aries/aries_vcx_ledger/Cargo.toml +++ b/aries/aries_vcx_ledger/Cargo.toml @@ -39,4 +39,4 @@ tokio = { workspace = true, default-features = false, features = [ "rt", ] } mockall.workspace = true -uuid = { workspace = true, default-features = false, features = ["v4"] } +uuid = { workspace = true } diff --git a/aries/aries_vcx_wallet/Cargo.toml b/aries/aries_vcx_wallet/Cargo.toml index 9961125324..5cb3aee95f 100644 --- a/aries/aries_vcx_wallet/Cargo.toml +++ b/aries/aries_vcx_wallet/Cargo.toml @@ -24,7 +24,7 @@ rand.workspace = true thiserror.workspace = true tokio = { workspace = true } typed-builder.workspace = true -uuid = { workspace = true, default-features = false, features = ["v4"] } +uuid = { workspace = true } [dev-dependencies] tokio = { workspace = true, features = ["rt", "macros", "rt-multi-thread"] } diff --git a/aries/messages/src/misc/mod.rs b/aries/messages/src/misc/mod.rs index ae768dd633..6993a72983 100644 --- a/aries/messages/src/misc/mod.rs +++ b/aries/messages/src/misc/mod.rs @@ -5,7 +5,6 @@ pub use mime_type::MimeType; pub use shared::misc::{serde_ignored::SerdeIgnored as NoDecorators, utils::CowStr}; #[cfg(test)] - pub mod test_utils { use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; @@ -21,7 +20,7 @@ pub mod test_utils { pub struct DateTimeRfc3339<'a>(pub &'a DateTime); - impl<'a> Serialize for DateTimeRfc3339<'a> { + impl Serialize for DateTimeRfc3339<'_> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, @@ -32,7 +31,7 @@ pub mod test_utils { pub struct OptDateTimeRfc3339<'a>(pub &'a Option>); - impl<'a> Serialize for OptDateTimeRfc3339<'a> { + impl Serialize for OptDateTimeRfc3339<'_> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, diff --git a/aries/messages/src/msg_fields/protocols/cred_issuance/v1/mod.rs b/aries/messages/src/msg_fields/protocols/cred_issuance/v1/mod.rs index feb1b0df59..054c36e643 100644 --- a/aries/messages/src/msg_fields/protocols/cred_issuance/v1/mod.rs +++ b/aries/messages/src/msg_fields/protocols/cred_issuance/v1/mod.rs @@ -142,7 +142,7 @@ impl<'a> From<&'a CredentialPreviewV1MsgType> for CredentialIssuanceTypeV1_0 { } } -impl<'a> TryFrom> for CredentialPreviewV1MsgType { +impl TryFrom> for CredentialPreviewV1MsgType { type Error = String; fn try_from(value: CowStr) -> Result { diff --git a/aries/messages/src/msg_fields/protocols/cred_issuance/v2/mod.rs b/aries/messages/src/msg_fields/protocols/cred_issuance/v2/mod.rs index 2253562b76..9b962cdc15 100644 --- a/aries/messages/src/msg_fields/protocols/cred_issuance/v2/mod.rs +++ b/aries/messages/src/msg_fields/protocols/cred_issuance/v2/mod.rs @@ -141,7 +141,7 @@ impl<'a> From<&'a CredentialPreviewV2MsgType> for CredentialIssuanceTypeV2_0 { } } -impl<'a> TryFrom> for CredentialPreviewV2MsgType { +impl TryFrom> for CredentialPreviewV2MsgType { type Error = String; fn try_from(value: CowStr) -> Result { diff --git a/aries/messages/src/msg_fields/protocols/routing.rs b/aries/messages/src/msg_fields/protocols/routing.rs index 02b8c992d3..7306eb9218 100644 --- a/aries/messages/src/msg_fields/protocols/routing.rs +++ b/aries/messages/src/msg_fields/protocols/routing.rs @@ -20,7 +20,6 @@ pub struct ForwardContent { into_msg_with_type!(Forward, RoutingTypeV1_0, Forward); #[cfg(test)] - mod tests { use serde_json::json; // Bind `shared::misc::serde_ignored::SerdeIgnored` type as `NoDecorators`. diff --git a/aries/misc/indy_ledger_response_parser/src/lib.rs b/aries/misc/indy_ledger_response_parser/src/lib.rs index 49ec2feee7..0047eadc09 100644 --- a/aries/misc/indy_ledger_response_parser/src/lib.rs +++ b/aries/misc/indy_ledger_response_parser/src/lib.rs @@ -58,7 +58,7 @@ impl ResponseParser { GetNymReplyResult::GetNymReplyResultV0(res) => { let data: GetNymResultDataV0 = res .data - .ok_or_else(|| LedgerResponseParserError::LedgerItemNotFound("NYM")) + .ok_or(LedgerResponseParserError::LedgerItemNotFound("NYM")) .and_then(|data| serde_json::from_str(&data).map_err(Into::into))?; NymData { @@ -192,7 +192,7 @@ impl ResponseParser { let data = match reply.result() { GetTxnAuthorAgreementResult::GetTxnAuthorAgreementResultV1(res) => res .data - .ok_or_else(|| LedgerResponseParserError::LedgerItemNotFound("TAA"))?, + .ok_or(LedgerResponseParserError::LedgerItemNotFound("TAA"))?, }; Ok(GetTxnAuthorAgreementData { diff --git a/aries/misc/legacy/diddoc_legacy/src/aries/diddoc.rs b/aries/misc/legacy/diddoc_legacy/src/aries/diddoc.rs index 28896afd63..22ce71a585 100644 --- a/aries/misc/legacy/diddoc_legacy/src/aries/diddoc.rs +++ b/aries/misc/legacy/diddoc_legacy/src/aries/diddoc.rs @@ -42,10 +42,9 @@ impl AriesDidDoc { } pub fn set_service_endpoint(&mut self, service_endpoint: Url) { - self.service.get_mut(0).map(|service| { + if let Some(service) = self.service.get_mut(0) { service.service_endpoint = service_endpoint; - service - }); + } } pub fn set_recipient_keys(&mut self, recipient_keys: Vec) { @@ -68,10 +67,9 @@ impl AriesDidDoc { public_key: key_reference, }); - self.service.get_mut(0).map(|service| { + if let Some(service) = self.service.get_mut(0) { service.recipient_keys.push(key_in_base58.clone()); - service - }); + } }); } @@ -91,10 +89,9 @@ impl AriesDidDoc { // public_key_base_58: key.clone(), // }); - self.service.get_mut(0).map(|service| { + if let Some(service) = self.service.get_mut(0) { service.routing_keys.push(key.to_string()); - service - }); + } }); } @@ -487,7 +484,6 @@ pub mod test_utils { } #[cfg(test)] - mod unit_tests { use serde_json::json; diff --git a/aries/misc/legacy/diddoc_legacy/src/w3c/model.rs b/aries/misc/legacy/diddoc_legacy/src/w3c/model.rs index fd8afb666c..3a5942982f 100644 --- a/aries/misc/legacy/diddoc_legacy/src/w3c/model.rs +++ b/aries/misc/legacy/diddoc_legacy/src/w3c/model.rs @@ -42,7 +42,6 @@ impl Serialize for DdoKeyReference { } #[cfg(test)] - mod unit_test { use crate::{aries::diddoc::test_utils::_did, w3c::model::DdoKeyReference}; diff --git a/aries/misc/shared/src/maybe_known.rs b/aries/misc/shared/src/maybe_known.rs index b21ecf5094..6df0fbe1a1 100644 --- a/aries/misc/shared/src/maybe_known.rs +++ b/aries/misc/shared/src/maybe_known.rs @@ -17,7 +17,6 @@ pub enum MaybeKnown { } #[cfg(test)] - mod tests { use serde::Deserialize; use serde_json::json; diff --git a/aries/misc/test_utils/Cargo.toml b/aries/misc/test_utils/Cargo.toml index c9d9ea37dd..44adfb2f63 100644 --- a/aries/misc/test_utils/Cargo.toml +++ b/aries/misc/test_utils/Cargo.toml @@ -30,7 +30,7 @@ indy-vdr-proxy-client = { workspace = true, optional = true } lazy_static.workspace = true serde_json.workspace = true rand.workspace = true -uuid = { workspace = true, default-features = false, features = ["v4"] } +uuid = { workspace = true } async-trait.workspace = true chrono.workspace = true env_logger.workspace = true diff --git a/did_core/did_doc/src/schema/did_doc.rs b/did_core/did_doc/src/schema/did_doc.rs index 4957c4dfc4..7b84cf5409 100644 --- a/did_core/did_doc/src/schema/did_doc.rs +++ b/did_core/did_doc/src/schema/did_doc.rs @@ -95,7 +95,7 @@ impl DidDocument { vm: &'a VerificationMethodKind, id: &str, ) -> Option<&'a VerificationMethod> { - return match vm { + match vm { VerificationMethodKind::Resolved(vm) => { if vm.id().fragment() == Some(id) { Some(vm) @@ -110,7 +110,7 @@ impl DidDocument { None } } - }; + } } pub fn authentication_by_id(&self, id: &str) -> Option<&VerificationMethod> { diff --git a/did_core/did_methods/did_peer/src/peer_did/mod.rs b/did_core/did_methods/did_peer/src/peer_did/mod.rs index 774943238c..ba5599544c 100644 --- a/did_core/did_methods/did_peer/src/peer_did/mod.rs +++ b/did_core/did_methods/did_peer/src/peer_did/mod.rs @@ -68,7 +68,7 @@ impl<'de, N: Numalgo> Deserialize<'de> for PeerDid { { struct PeerDidVisitor(PhantomData); - impl<'de, N: Numalgo> Visitor<'de> for PeerDidVisitor { + impl Visitor<'_> for PeerDidVisitor { type Value = PeerDid; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {