Skip to content

Commit

Permalink
Allow parsing Ints as object keys
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj committed Oct 13, 2019
1 parent 25c5f34 commit 0ef582a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/structs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ function construct(::Type{E}, ptr::Ptr{UInt8}, len::Int) where {E <: Enum}
end

construct(T, str::String) = T(str)
construct(::Type{Int}, str::String) = Parsers.parse(Int, str)
construct(T, ptr::Ptr{UInt8}, len::Int) = construct(T, unsafe_string(ptr, len))
construct(::Type{Symbol}, ptr::Ptr{UInt8}, len::Int) = _symbol(ptr, len)

Expand Down

0 comments on commit 0ef582a

Please sign in to comment.