Skip to content

Commit 925bd9b

Browse files
committed
graph-craft: fix no serde feature failing to compile
1 parent 939d473 commit 925bd9b

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

node-graph/graph-craft/src/document.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,10 +676,12 @@ fn migrate_layer_to_merge<'de, D: serde::Deserializer<'de>>(deserializer: D) ->
676676
Ok(s)
677677
}
678678
// TODO: Eventually remove this document upgrade code
679+
#[cfg(feature = "serde")]
679680
fn default_import_metadata() -> (NodeId, IVec2) {
680681
(NodeId::new(), IVec2::new(-25, -4))
681682
}
682683
// TODO: Eventually remove this document upgrade code
684+
#[cfg(feature = "serde")]
683685
fn default_export_metadata() -> (NodeId, IVec2) {
684686
(NodeId::new(), IVec2::new(8, -4))
685687
}

node-graph/graph-craft/src/proto.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,8 @@ impl ProtoNetwork {
532532
Ok(())
533533
}
534534
}
535-
#[derive(Clone, PartialEq, serde::Serialize, serde::Deserialize)]
535+
#[derive(Clone, PartialEq)]
536+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
536537
pub enum GraphErrorType {
537538
NodeNotFound(NodeId),
538539
InputNodeNotFound(NodeId),
@@ -588,7 +589,8 @@ impl core::fmt::Debug for GraphErrorType {
588589
}
589590
}
590591
}
591-
#[derive(Clone, PartialEq, serde::Serialize, serde::Deserialize)]
592+
#[derive(Clone, PartialEq)]
593+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
592594
pub struct GraphError {
593595
pub node_path: Vec<NodeId>,
594596
pub identifier: Cow<'static, str>,

0 commit comments

Comments
 (0)