Skip to content

Commit d06fd00

Browse files
committed
Add hex for Chr types in v0.6
1 parent 32aac58 commit d06fd00

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/compat.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ in(x::Chr, y::Chr) = x == y
2828
+(x::Integer, y::Chr) = y + x
2929
show(io::IO, cp::Chr) = show(io, Char(cp))
3030
print(io::IO, cp::Chr) = print(io, Char(cp))
31+
32+
Base.hex(chr::C) where {C<:Chr} = hex(codepoint(chr))
33+
Base.hex(chr::C, pad) where {C<:Chr} = hex(codepoint(chr), pad)

0 commit comments

Comments
 (0)