Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unused code and suppressed warnings/errors #1262

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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;
}
Loading