Skip to content

Commit f059115

Browse files
committed
Remove Base.@kwdef for 1.0 compatibility
1 parent af3f853 commit f059115

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/metagraph.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ It is recommended not to set `Label` to an integer type, so as to avoid confusio
1616
- `weight_function::WeightFunction`: function defining edge weight from edge metadata
1717
- `default_weight::U`: default weight for the edges
1818
"""
19-
Base.@kwdef struct MetaGraph{
19+
struct MetaGraph{
2020
T<:Integer,Label,Graph,VertexData,EdgeData,GraphData,WeightFunction,U<:Real
2121
} <: AbstractGraph{T}
2222
graph::Graph
@@ -54,15 +54,15 @@ function MetaGraph(
5454
if Label <: Integer
5555
@warn "Constructing a MetaGraph with integer labels is not advised."
5656
end
57-
return MetaGraph(;
58-
graph=graph,
59-
vertex_labels=Dict{T,Label}(),
60-
vertex_codes=Dict{Label,T}(),
61-
vertex_data=Dict{Label,VertexData}(),
62-
edge_data=Dict{Tuple{Label,Label},EdgeData}(),
63-
graph_data=graph_data,
64-
weight_function=weight_function,
65-
default_weight=default_weight,
57+
return MetaGraph(
58+
graph,
59+
Dict{T,Label}(),
60+
Dict{Label,T}(),
61+
Dict{Label,VertexData}(),
62+
Dict{Tuple{Label,Label},EdgeData}(),
63+
graph_data,
64+
weight_function,
65+
default_weight,
6666
)
6767
end
6868

0 commit comments

Comments
 (0)