From 489f132e77c79aaffea71c327a5e48e74c1369eb Mon Sep 17 00:00:00 2001 From: Dominic Grimm Date: Sat, 20 Nov 2021 14:47:27 +0100 Subject: [PATCH] updated types --- src/lifo/lifolike.cr | 2 +- src/lifo/stack.cr | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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