Skip to content

Commit c1725d4

Browse files
committed
Fix mutating make! return type to return any applyeach state
1 parent efb7f8c commit c1725d4

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "StructUtils"
22
uuid = "ec057cc2-7a8d-4b58-b3b3-92acb9f63b42"
3-
version = "2.0.2"
3+
version = "2.0.3"
44

55
[deps]
66
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

src/StructUtils.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -968,15 +968,14 @@ make!(::Type{T}, source; style::StructStyle=DefaultStyle()) where {T} = make!(st
968968

969969
function make!(style::StructStyle, x::T, source) where {T}
970970
if dictlike(style, x)
971-
makedict!(identity, style, x, source)
971+
return makedict!(identity, style, x, source)
972972
elseif arraylike(style, x)
973-
makearray!(identity, style, x, source)
973+
return makearray!(identity, style, x, source)
974974
elseif noarg(style, x)
975-
makenoarg!(identity, style, x, source)
975+
return makenoarg!(identity, style, x, source)
976976
else
977977
throw(ArgumentError("Type `$T` does not support in-place `make!`"))
978978
end
979-
return x
980979
end
981980

982981
make!(style::StructStyle, ::Type{T}, source) where {T} = make!(style, initialize(style, T, source), source)

0 commit comments

Comments
 (0)