Skip to content

Commit

Permalink
Merge pull request #94 from AlgebraicJulia/pas/json_empty_vect
Browse files Browse the repository at this point in the history
Changed `InterTypes` `write` for `Vector{T}` to prevent erroring on empty vectors
  • Loading branch information
olynch authored Dec 19, 2023
2 parents 813a4e1 + a39c205 commit 0b5c038
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/intertypes/json.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function read(format::JSONFormat, ::Type{Vector{T}}, s::JSON3.Array) where {T}
end
function write(io::IO, format::JSONFormat, d::Vector{T}) where {T}
print(io, "[")
joinwith(io, (io, x) -> write(io, format, x), d, ",")
if length(d) > 0 joinwith(io, (io, x) -> write(io, format, x), d, ",") end
print(io, "]")
end

Expand Down

0 comments on commit 0b5c038

Please sign in to comment.