Skip to content

Commit 85c96b9

Browse files
JeffBezansonKeno
andauthored
define show instead of repr in BinaryPlatforms (#51398)
Co-authored-by: Keno Fischer <keno@juliacomputing.com>
1 parent 5fc5556 commit 85c96b9

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

base/binaryplatforms.jl

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,18 @@ end
170170

171171

172172
# Allow us to easily serialize Platform objects
173-
function Base.repr(p::Platform; context=nothing)
174-
str = string(
175-
"Platform(",
176-
repr(arch(p)),
177-
", ",
178-
repr(os(p)),
179-
"; ",
180-
join(("$(k) = $(repr(v))" for (k, v) in tags(p) if k ("arch", "os")), ", "),
181-
")",
182-
)
173+
function Base.show(io::IO, p::Platform)
174+
print(io, "Platform(")
175+
show(io, arch(p))
176+
print(io, ", ")
177+
show(io, os(p))
178+
print(io, "; ")
179+
join(io, ("$(k) = $(repr(v))" for (k, v) in tags(p) if k ("arch", "os")), ", ")
180+
print(io, ")")
183181
end
184182

185183
# Make showing the platform a bit more palatable
186-
function Base.show(io::IO, p::Platform)
184+
function Base.show(io::IO, ::MIME"text/plain", p::Platform)
187185
str = string(platform_name(p), " ", arch(p))
188186
# Add on all the other tags not covered by os/arch:
189187
other_tags = sort!(filter!(kv -> kv[1] ("os", "arch"), collect(tags(p))))

0 commit comments

Comments
 (0)