Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Feb 7, 2023
1 parent bfc4c84 commit 136378f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions crates/turbo-tasks-fs/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,9 @@ pub fn parse_json_with_source_context<'de, T: Deserialize<'de>>(text: &'de str)
let de = &mut serde_json::Deserializer::from_str(text);
match serde_path_to_error::deserialize(de) {
Ok(data) => Ok(data),
Err(e) => {
return Err(anyhow::Error::msg(
UnparseableJson::from_serde_path_to_error(e).to_string_with_content(text),
))
}
Err(e) => Err(anyhow::Error::msg(
UnparseableJson::from_serde_path_to_error(e).to_string_with_content(text),
)),
}
}

Expand All @@ -114,9 +112,9 @@ pub fn parse_json_rope_with_source_context<'de, T: Deserialize<'de>>(rope: &'de
Ok(data) => Ok(data),
Err(e) => {
let cow = rope.to_str()?;
return Err(anyhow::Error::msg(
Err(anyhow::Error::msg(
UnparseableJson::from_serde_path_to_error(e).to_string_with_content(&cow),
));
))
}
}
}
2 changes: 1 addition & 1 deletion crates/turbopack-json/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl EcmascriptChunkItem for JsonChunkItem {
} else {
write!(message, "{}", e)?;
}
return Err(Error::msg(message));
Err(Error::msg(message))
}
FileJsonContent::NotFound => {
bail!(
Expand Down

0 comments on commit 136378f

Please sign in to comment.