Skip to content

Commit

Permalink
fix: include schema rather than read file (#807)
Browse files Browse the repository at this point in the history
otherwise fails miri checks by opening file

running workflow manually to check
  • Loading branch information
ss2165 committed Jan 15, 2024
1 parent 57d840c commit b7543db
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/hugr/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,20 +274,16 @@ pub mod test {
use portgraph::{
multiportgraph::MultiPortGraph, Hierarchy, LinkMut, PortMut, PortView, UnmanagedDenseMap,
};
use std::fs;

const NAT: Type = crate::extension::prelude::USIZE_T;
const QB: Type = crate::extension::prelude::QB_T;

lazy_static! {
static ref SCHEMA: JSONSchema = {
let path = format!(
"{}/specification/schema/hugr_schema_v0.json",
env!("CARGO_MANIFEST_DIR")
);
let data = fs::read_to_string(path).unwrap();
let schema_val: serde_json::Value = serde_json::from_str(&data).unwrap();

let schema_val: serde_json::Value = serde_json::from_str(include_str!(
"../../specification/schema/hugr_schema_v0.json"
))
.unwrap();
JSONSchema::options()
.with_draft(Draft::Draft7)
.compile(&schema_val)
Expand Down

0 comments on commit b7543db

Please sign in to comment.