Skip to content

Commit d409741

Browse files
Jutholkdvos
andauthored
add type assertion for stability
Co-authored-by: Lukas Devos <[email protected]>
1 parent dbeaab2 commit d409741

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tensors/blockiterator.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ end
4747

4848
function show_blocks(io, mime::MIME"text/plain", iter; maytruncate::Bool = true)
4949
if maytruncate && get(io, :limit, false)
50-
numlinesleft, numcols = get(io, :displaysize, displaysize(io))
50+
numlinesleft, numcols = get(io, :displaysize, displaysize(io))::Tuple{Int, Int}
5151
numlinesleft -= 2 # lines of headers have already been subtracted, but not the 2 spare lines for old and new prompts
5252
minlinesperblock = 7 # aim to have at least this many lines per printed block (= 5 lines for the actual matrix)
5353
minnumberofblocks = min(3, length(iter)) # aim to show at least this many blocks
@@ -100,7 +100,7 @@ end
100100
function Base.show(io::IO, mime::MIME"text/plain", b::BlockIterator)
101101
summary(io, b)
102102
println(io, ":")
103-
(numlines, numcols) = get(io, :displaysize, displaysize(io))
103+
(numlines, numcols) = get(io, :displaysize, displaysize(io))::Tuple{Int, Int}
104104
newio = IOContext(io, :displaysize => (numlines - 1, numcols))
105105
show_blocks(newio, mime, b; maytruncate = false)
106106
return nothing

0 commit comments

Comments
 (0)