Skip to content

Commit

Permalink
Merge pull request #63 from xJonathanLEI/dev/parse_str
Browse files Browse the repository at this point in the history
feat: make `parse()` accept `&str`
  • Loading branch information
Okm165 authored Jan 4, 2025
2 parents 2eba10b + e2aaec0 commit a9f8048
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions proof_parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ pub mod stark_proof;

pub use stark_proof::*;

pub fn parse(input: String) -> anyhow::Result<stark_proof::StarkProof> {
let proof_json = serde_json::from_str::<json_parser::StarkProof>(&input)?;
pub fn parse<I: AsRef<str>>(input: I) -> anyhow::Result<stark_proof::StarkProof> {
let proof_json = serde_json::from_str::<json_parser::StarkProof>(input.as_ref())?;
stark_proof::StarkProof::try_from(proof_json)
}

Expand Down

0 comments on commit a9f8048

Please sign in to comment.