Skip to content

Commit

Permalink
Removed unused code and suppressed warnings/errors (#1262)
Browse files Browse the repository at this point in the history
* removed unused code and suppressed warnings/erros

Signed-off-by: Alberto Leon <alberto@instnt.org>

* fixed formatting

Signed-off-by: Alberto Leon <alberto@instnt.org>

---------

Signed-off-by: Alberto Leon <alberto@instnt.org>
  • Loading branch information
alberto-instnt authored Jul 9, 2024
1 parent 9c68a55 commit 9d5f1b5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
1 change: 1 addition & 0 deletions aries/aries_vcx/src/protocols/connection/trait_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ pub struct RevocationRegistryInfo {
struct WalletAdapter(Arc<dyn BaseWallet>);

#[async_trait]
#[allow(dead_code)]
impl RecordWallet for WalletAdapter {
async fn all_records(&self) -> VcxWalletResult<Box<dyn AllRecords + Send>> {
self.0.all_records().await
Expand Down
20 changes: 2 additions & 18 deletions aries/aries_vcx_anoncreds/src/utils/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self::Val>;
}

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<String, Value>>;

#[allow(dead_code)]
fn try_as_bool(&self) -> VcxAnoncredsResult<bool>;

#[allow(dead_code)]
fn try_as_array(&self) -> VcxAnoncredsResult<&Vec<Value>>;
}

Expand Down
3 changes: 3 additions & 0 deletions aries/misc/legacy/libvdrtools/indy-wallet/src/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<WalletCacheValue>;
#[allow(dead_code)]
fn peek(&self, key: &WalletCacheKey) -> Option<&WalletCacheValue>;
#[allow(dead_code)]
fn len(&self) -> usize;
#[allow(dead_code)]
fn cap(&self) -> usize;
}

0 comments on commit 9d5f1b5

Please sign in to comment.