Skip to content

Commit

Permalink
Read to bytes instead of string
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoletta committed Apr 16, 2024
1 parent 3178e0b commit 9a3c2c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cairo1-run/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ fn run(args: impl Iterator<Item = String>) -> Result<Option<String>, Error> {
};

// Try to parse the file as a sierra program
let file = std::fs::read_to_string(&args.filename)?;
let sierra_program = match serde_json::from_str(&file) {
let file = std::fs::read(&args.filename)?;
let sierra_program = match serde_json::from_slice(&file) {
Ok(program) => program,
Err(_) => {
// If it fails, try to compile it as a cairo program
Expand Down

0 comments on commit 9a3c2c7

Please sign in to comment.