Skip to content

Commit

Permalink
feat: make parse() accept &str
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Jan 4, 2025
1 parent 2eba10b commit e2aaec0
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 e2aaec0

Please sign in to comment.