diff --git a/src/lifo/lifolike.cr b/src/lifo/lifolike.cr index 78b3931..e843d34 100644 --- a/src/lifo/lifolike.cr +++ b/src/lifo/lifolike.cr @@ -9,7 +9,7 @@ module Lifo end end - def size : Int + def size : Int32 @data.size end diff --git a/src/lifo/stack.cr b/src/lifo/stack.cr index 8c2a4e0..92bd833 100644 --- a/src/lifo/stack.cr +++ b/src/lifo/stack.cr @@ -4,7 +4,7 @@ module Lifo super(capacity) end - def push(e : T) : Int32 + def push(e : T) : Int if @capacity == -1 || size < @capacity @data << e @@ -14,7 +14,7 @@ module Lifo end end - def push?(e : T) : Int32? + def push?(e : T) : Int? begin push(e) rescue OverflowError