mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-04 21:37:59 +00:00
Fix profiling CI action failing (#2734)
This commit is contained in:
parent
14d90195ad
commit
68985868fa
1 changed files with 7 additions and 0 deletions
|
@ -1,4 +1,6 @@
|
|||
use crate::document::NodeNetwork;
|
||||
use crate::graphene_compiler::Compiler;
|
||||
use crate::proto::ProtoNetwork;
|
||||
|
||||
pub fn load_network(document_string: &str) -> NodeNetwork {
|
||||
let document: serde_json::Value = serde_json::from_str(document_string).expect("Failed to parse document");
|
||||
|
@ -6,6 +8,11 @@ pub fn load_network(document_string: &str) -> NodeNetwork {
|
|||
serde_json::from_str::<NodeNetwork>(&document).expect("Failed to parse document")
|
||||
}
|
||||
|
||||
pub fn compile(network: NodeNetwork) -> ProtoNetwork {
|
||||
let compiler = Compiler {};
|
||||
compiler.compile_single(network).unwrap()
|
||||
}
|
||||
|
||||
pub fn load_from_name(name: &str) -> NodeNetwork {
|
||||
let content = std::fs::read(format!("../../demo-artwork/{name}.graphite")).expect("failed to read file");
|
||||
let content = std::str::from_utf8(&content).unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue