updated types

This commit is contained in:
Dominic Grimm 2021-11-20 14:47:27 +01:00
parent 6427c7681c
commit 489f132e77
2 changed files with 3 additions and 3 deletions

View file

@ -9,7 +9,7 @@ module Lifo
end end
end end
def size : Int def size : Int32
@data.size @data.size
end end

View file

@ -4,7 +4,7 @@ module Lifo
super(capacity) super(capacity)
end end
def push(e : T) : Int32 def push(e : T) : Int
if @capacity == -1 || size < @capacity if @capacity == -1 || size < @capacity
@data << e @data << e
@ -14,7 +14,7 @@ module Lifo
end end
end end
def push?(e : T) : Int32? def push?(e : T) : Int?
begin begin
push(e) push(e)
rescue OverflowError rescue OverflowError