Skip to content

Commit 60d5a98

Browse files
committed
simpler, more green
1 parent d39d1c3 commit 60d5a98

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/interface.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,10 @@ Broadcast.materialize(x::Lazy) = Broadcast.instantiate(x.bc)
118118
onevalue::T, x::AbstractArray{T}) where T = map(_ -> λ, x)
119119
onevalue(λ, x::AbstractArray{T}) where T = onevalue(convert(float(T), λ), x)
120120

121-
function Base.show(io::IO, ℓ::Leaf) # show method is mostly to hide its long type!
121+
function Base.show(io::IO, ℓ::Leaf)
122122
ioc = IOContext(io, :compact => true)
123-
printstyled(io, "Leaf("; color = :green)
124-
show(ioc, ℓ.rule)
125-
printstyled(", "; color = :green)
123+
str = sprint(show, ℓ.rule; context = ioc)
124+
printstyled(io, "Leaf(", str, ", "; color = :green)
126125
str = sprint(show, ℓ.state; context = ioc)
127126
print(io, length(str) < 70 ? str : first(str, 50) * "")
128127
printstyled(io, ")"; color = :green)

0 commit comments

Comments
 (0)