Skip to content

Commit

Permalink
added specialized implementation of string(::Symbol) (JuliaLang#36627)
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausC authored Jul 13, 2020
1 parent 78bd857 commit ef2a3a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/strings/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ julia> string("a", 1, true)
"""
string(xs...) = print_to_string(xs...)

string(a::Symbol) = String(a)

# note: print uses an encoding determined by `io` (defaults to UTF-8), whereas
# write uses an encoding determined by `s` (UTF-8 for `String`)
print(io::IO, s::AbstractString) = for c in s; print(io, c); end
Expand Down

0 comments on commit ef2a3a8

Please sign in to comment.