Skip to content

Commit

Permalink
Remove dependency on Printf
Browse files Browse the repository at this point in the history
This dependency was used for something completely trivial.
  • Loading branch information
jakobnissen committed Mar 1, 2023
1 parent 8dd2672 commit 7c6a696
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ authors = ["Kenta Sato <[email protected]>", "Jakob Nybo Nissen <jakobnyboni
version = "0.8.2"

[deps]
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
ScanByte = "7b38b023-a4d7-4c5e-8d43-3f3097f304eb"
TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"

Expand Down
1 change: 0 additions & 1 deletion src/Automa.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Automa

using Printf: @sprintf
import ScanByte: ScanByte, ByteSet

# Encode a byte set into a sequence of non-empty ranges.
Expand Down
7 changes: 6 additions & 1 deletion src/dot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ function edge2str(edge::Edge)
elseif inrange && b == UInt8(']')
print(out, "\\\\]")
else
print(out, escape_string(b 0x7f ? escape_string(string(Char(b))) : @sprintf("\\x%x", b)))
s = if b 0x7f
escape_string(string(Char(b)))
else
"\\x" * string(b; base=16)
end
print(out, escape_string(s))
end
end

Expand Down

0 comments on commit 7c6a696

Please sign in to comment.