Skip to content

Commit

Permalink
fix clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wulfraem committed Nov 28, 2024
1 parent 81b426f commit 4b06bff
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions identity_iota/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ identity_resolver = { version = "=1.4.0", path = "../identity_resolver", default
identity_storage = { version = "=1.4.0", path = "../identity_storage", default-features = false, features = ["iota-document"] }
identity_verification = { version = "=1.4.0", path = "../identity_verification", default-features = false }

[dev-dependencies]
anyhow = "1.0.64"
iota-sdk = { git = "https://github.com/iotaledger/iota.git", package = "iota-sdk", rev = "39c83ddcf07894cdee2abd146381d8704205e6e9" }
rand = "0.8.5"
tokio = { version = "1.29.0", features = ["full"] }

[features]
default = ["revocation-bitmap", "iota-client", "resolver"]

Expand Down
6 changes: 3 additions & 3 deletions identity_iota_core/tests/e2e/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ lazy_static! {
}

pub async fn get_client() -> anyhow::Result<TestClient> {
{
let client = IotaClientBuilder::default().build_localnet().await?;
let package_id = PACKAGE_ID.get_or_try_init(|| init(&client)).await.copied()?;
let address = get_active_address().await?;
Expand All @@ -91,7 +90,6 @@ pub async fn get_client() -> anyhow::Result<TestClient> {
address,
storage,
})
}.inspect_err(|e: &anyhow::Error| {println!("{e}"); println!("{:?}", e.source());})
}

async fn init(iota_client: &IotaClient) -> anyhow::Result<ObjectID> {
Expand Down Expand Up @@ -232,7 +230,9 @@ impl TestClient {
.await?;
let new_address = {
let output_str = std::str::from_utf8(&output.stdout).unwrap();
let start_of_json = output_str.find('{').ok_or(anyhow!("No json in output: {}", output_str))?;
let start_of_json = output_str
.find('{')
.ok_or(anyhow!("No json in output: {}", output_str))?;
let json_result = serde_json::from_str::<Value>(output_str[start_of_json..].trim())?;
let address_json = json_result
.path("$.address")
Expand Down
2 changes: 1 addition & 1 deletion identity_jose/src/jws/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<JwsValidationItem<'payload>>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
4 changes: 2 additions & 2 deletions identity_jose/src/jws/encoding/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
serde_json::to_string(&self).map_err(Error::InvalidJson)
}
Expand All @@ -99,7 +99,7 @@ pub(super) struct General<'payload, 'unprotected> {
pub(super) signatures: Vec<JwsSignature<'unprotected>>,
}

impl<'payload, 'unprotected> General<'payload, 'unprotected> {
impl General<'_, '_> {
pub(super) fn to_json(&self) -> Result<String> {
serde_json::to_string(&self).map_err(Error::InvalidJson)
}
Expand Down
2 changes: 1 addition & 1 deletion identity_jose/src/jws/recipient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 4b06bff

Please sign in to comment.