Skip to content

Commit

Permalink
Simplify converting to Vector{UInt8} (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickrobinson251 committed Oct 4, 2022
1 parent 7f5ec92 commit 20f125c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/InlineStrings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ function Base.Symbol(x::T) where {T <: InlineString}
(Ref{T}, Int), ref, sizeof(x))
end

Base.Vector{UInt8}(s::InlineString) = Vector{UInt8}(codeunits(s))
Base.Array{UInt8}(s::InlineString) = Vector{UInt8}(codeunits(s))

# add a codeunit to end of string method
function addcodeunit(x::T, b::UInt8) where {T <: InlineString}
if T === InlineString1
Expand Down

0 comments on commit 20f125c

Please sign in to comment.