From c8ac9b6bfe8ba6576eaa9d80ce06d7267747d9ed Mon Sep 17 00:00:00 2001 From: alberto-instnt <113043904+alberto-instnt@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:25:53 -0400 Subject: [PATCH] Removed unused code and suppressed warnings/errors (#1262) * removed unused code and suppressed warnings/erros Signed-off-by: Alberto Leon * fixed formatting Signed-off-by: Alberto Leon --------- Signed-off-by: Alberto Leon Signed-off-by: lli --- .../src/protocols/connection/trait_bounds.rs | 1 + .../src/anoncreds/credx_anoncreds/mod.rs | 1 + aries/aries_vcx_anoncreds/src/utils/json.rs | 20 ++----------------- .../libvdrtools/indy-wallet/src/cache/mod.rs | 3 +++ 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/aries/aries_vcx/src/protocols/connection/trait_bounds.rs b/aries/aries_vcx/src/protocols/connection/trait_bounds.rs index 47e668c26f..a9004ebb48 100644 --- a/aries/aries_vcx/src/protocols/connection/trait_bounds.rs +++ b/aries/aries_vcx/src/protocols/connection/trait_bounds.rs @@ -31,4 +31,5 @@ pub trait CompletedState { /// Marker trait used for implementing /// [`messages::protocols::connection::problem_report::ProblemReport`] handling on certain /// [`super::Connection`] types. +#[allow(dead_code)] pub trait HandleProblem {} diff --git a/aries/aries_vcx_anoncreds/src/anoncreds/credx_anoncreds/mod.rs b/aries/aries_vcx_anoncreds/src/anoncreds/credx_anoncreds/mod.rs index 5b298ee287..afe0796c95 100644 --- a/aries/aries_vcx_anoncreds/src/anoncreds/credx_anoncreds/mod.rs +++ b/aries/aries_vcx_anoncreds/src/anoncreds/credx_anoncreds/mod.rs @@ -92,6 +92,7 @@ pub struct RevocationRegistryInfo { struct WalletAdapter(Arc); #[async_trait] +#[allow(dead_code)] impl RecordWallet for WalletAdapter { async fn all_records(&self) -> VcxWalletResult> { self.0.all_records().await diff --git a/aries/aries_vcx_anoncreds/src/utils/json.rs b/aries/aries_vcx_anoncreds/src/utils/json.rs index 3d7245e7fc..1e35a1cfde 100644 --- a/aries/aries_vcx_anoncreds/src/utils/json.rs +++ b/aries/aries_vcx_anoncreds/src/utils/json.rs @@ -7,29 +7,13 @@ use serde_json::{Map, Value}; use crate::errors::error::{VcxAnoncredsError, VcxAnoncredsResult}; -pub(crate) trait TryGetIndex { - type Val; - fn try_get(&self, index: &str) -> VcxAnoncredsResult; -} - -impl<'a> TryGetIndex for &'a Value { - type Val = &'a Value; - fn try_get(&self, index: &str) -> VcxAnoncredsResult<&'a Value> { - self.get(index).ok_or_else(|| { - VcxAnoncredsError::InvalidJson(format!( - "Could not index '{index}' in Value payload: {self:?}" - )) - }) - } -} - pub(crate) trait AsTypeOrDeserializationError { fn try_as_str(&self) -> VcxAnoncredsResult<&str>; fn try_as_object(&self) -> VcxAnoncredsResult<&Map>; - + #[allow(dead_code)] fn try_as_bool(&self) -> VcxAnoncredsResult; - + #[allow(dead_code)] fn try_as_array(&self) -> VcxAnoncredsResult<&Vec>; } diff --git a/aries/misc/legacy/libvdrtools/indy-wallet/src/cache/mod.rs b/aries/misc/legacy/libvdrtools/indy-wallet/src/cache/mod.rs index 747dc487fc..f01402ac65 100644 --- a/aries/misc/legacy/libvdrtools/indy-wallet/src/cache/mod.rs +++ b/aries/misc/legacy/libvdrtools/indy-wallet/src/cache/mod.rs @@ -8,7 +8,10 @@ pub trait Cache { fn get(&mut self, key: &WalletCacheKey) -> Option<&WalletCacheValue>; fn get_mut(&mut self, key: &WalletCacheKey) -> Option<&mut WalletCacheValue>; fn pop(&mut self, key: &WalletCacheKey) -> Option; + #[allow(dead_code)] fn peek(&self, key: &WalletCacheKey) -> Option<&WalletCacheValue>; + #[allow(dead_code)] fn len(&self) -> usize; + #[allow(dead_code)] fn cap(&self) -> usize; }