Skip to content

Commit

Permalink
Add Queue show method to hide backing Deque
Browse files Browse the repository at this point in the history
I was looking over the Queue method per JuliaCollections#479 and while I didn't find any issues I noticed that during printing at the REPL the backing Deque is printed inside. Decided to try to write a small show method to hide the backing type to pretty it up.
  • Loading branch information
jordancluts authored Apr 27, 2021
1 parent 0230564 commit 03e8fe7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/queue.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@ Base.iterate(q::Queue, s...) = iterate(q.store, s...)
Iterators.reverse(q::Queue) = Iterators.reverse(q.store)

Base.:(==)(x::Queue, y::Queue) = x.store == y.store

# Showing

function Base.show(io::IO, s::Queue)
print(io,"Queue [$(collect(s.store))]")
end

0 comments on commit 03e8fe7

Please sign in to comment.