diff --git a/crates/web5/src/credentials/jwt_payload_vc.rs b/crates/web5/src/credentials/jwt_payload_vc.rs index 8e755260..94b737b1 100644 --- a/crates/web5/src/credentials/jwt_payload_vc.rs +++ b/crates/web5/src/credentials/jwt_payload_vc.rs @@ -67,6 +67,6 @@ impl ToJsonValue for JwtPayloadVerifiableCredential { fn to_json_value(&self) -> Result { let json_string = serde_json::to_string(self)?; let map = serde_json::from_str::>(&json_string)?; - Ok(map.to_json_value()?) + map.to_json_value() } } diff --git a/crates/web5/src/credentials/verifiable_presentation_1_1.rs b/crates/web5/src/credentials/verifiable_presentation_1_1.rs index a9374f34..038ec987 100644 --- a/crates/web5/src/credentials/verifiable_presentation_1_1.rs +++ b/crates/web5/src/credentials/verifiable_presentation_1_1.rs @@ -101,7 +101,7 @@ impl ToJsonValue for JwtPayloadVerifiablePresentation { fn to_json_value(&self) -> Result { let json_string = serde_json::to_string(self)?; let map = serde_json::from_str::>(&json_string)?; - Ok(map.to_json_value()?) + map.to_json_value() } } diff --git a/crates/web5/src/jose.rs b/crates/web5/src/jose.rs index 296c1060..e564885b 100644 --- a/crates/web5/src/jose.rs +++ b/crates/web5/src/jose.rs @@ -141,7 +141,7 @@ impl Jwt { pub fn from_compact_jws(compact_jws: &str, verify: bool) -> Result { let parts = compact_jws - .split(".") + .split('.') .map(String::from) .collect::>(); if parts.len() != 3 { diff --git a/crates/web5/src/json.rs b/crates/web5/src/json.rs index 33e7903d..756ad038 100644 --- a/crates/web5/src/json.rs +++ b/crates/web5/src/json.rs @@ -51,7 +51,7 @@ pub(crate) fn json_value_type_name(value: &JsonValue) -> &'static str { impl FromJsonValue for bool { fn from_json_value(value: &JsonValue) -> Result { if let JsonValue::Bool(ref b) = *value { - Ok(b.clone()) + Ok(*b) } else { Err(Web5Error::Json(format!( "expected bool, but found {}", @@ -64,7 +64,7 @@ impl FromJsonValue for bool { impl FromJsonValue for f64 { fn from_json_value(value: &JsonValue) -> Result { if let JsonValue::Number(ref n) = *value { - Ok(n.clone()) + Ok(*n) } else { Err(Web5Error::Json(format!( "expected number, but found {}",