Skip to content

Commit 943f061

Browse files
authored
Add Codable conformance to Graph types (#215)
1 parent 971395b commit 943f061

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

Sources/DataStructures/Graph/DirectedGraph.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,4 @@ extension DirectedGraph {
6565

6666
extension DirectedGraph: Equatable { }
6767
extension DirectedGraph: Hashable { }
68+
extension DirectedGraph: Codable where Node: Codable { }

Sources/DataStructures/Graph/Graph.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ extension Graph {
5858

5959
extension Graph: Equatable { }
6060
extension Graph: Hashable { }
61+
extension Graph: Codable where Node: Codable { }

Sources/DataStructures/Graph/WeightedDirectedGraph.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ extension WeightedDirectedGraph {
5454

5555
extension WeightedDirectedGraph: Equatable where Weight: Equatable { }
5656
extension WeightedDirectedGraph: Hashable where Weight: Hashable { }
57+
extension WeightedDirectedGraph: Codable where Node: Codable, Weight: Codable { }

Sources/DataStructures/Graph/WeightedGraph.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,4 @@ extension WeightedGraph {
6262

6363
extension WeightedGraph: Equatable where Weight: Equatable { }
6464
extension WeightedGraph: Hashable where Weight: Hashable { }
65+
extension WeightedGraph: Codable where Node: Codable, Weight: Codable { }

0 commit comments

Comments
 (0)