Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
KendallWeihe committed Sep 10, 2024
1 parent 2219045 commit 6c0bce1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/web5/src/credentials/jwt_payload_vc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ impl ToJsonValue for JwtPayloadVerifiableCredential {
fn to_json_value(&self) -> Result<JsonValue> {
let json_string = serde_json::to_string(self)?;
let map = serde_json::from_str::<HashMap<String, JsonValue>>(&json_string)?;
Ok(map.to_json_value()?)
map.to_json_value()
}
}
2 changes: 1 addition & 1 deletion crates/web5/src/credentials/verifiable_presentation_1_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl ToJsonValue for JwtPayloadVerifiablePresentation {
fn to_json_value(&self) -> Result<JsonValue> {
let json_string = serde_json::to_string(self)?;
let map = serde_json::from_str::<HashMap<String, JsonValue>>(&json_string)?;
Ok(map.to_json_value()?)
map.to_json_value()
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/web5/src/jose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl Jwt {

pub fn from_compact_jws(compact_jws: &str, verify: bool) -> Result<Self> {
let parts = compact_jws
.split(".")
.split('.')
.map(String::from)
.collect::<Vec<String>>();
if parts.len() != 3 {
Expand Down
4 changes: 2 additions & 2 deletions crates/web5/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self> {
if let JsonValue::Bool(ref b) = *value {
Ok(b.clone())
Ok(*b)
} else {
Err(Web5Error::Json(format!(
"expected bool, but found {}",
Expand All @@ -64,7 +64,7 @@ impl FromJsonValue for bool {
impl FromJsonValue for f64 {
fn from_json_value(value: &JsonValue) -> Result<Self> {
if let JsonValue::Number(ref n) = *value {
Ok(n.clone())
Ok(*n)
} else {
Err(Web5Error::Json(format!(
"expected number, but found {}",
Expand Down

0 comments on commit 6c0bce1

Please sign in to comment.