Address Ameba errors

This commit is contained in:
Michael Miller 2021-01-30 18:57:29 -07:00
parent e8b284fc60
commit 17a3f27029
No known key found for this signature in database
GPG Key ID: FB9F12F7C646A4AD
2 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ module Spectator
# This consists of the label (if one is available) and the value. # This consists of the label (if one is available) and the value.
def inspect(io) def inspect(io)
if (label = @label) if (label = @label)
io << @label io << label
io << ':' io << ':'
io << ' ' io << ' '
end end

View File

@ -8,8 +8,8 @@ module Spectator
# The block should return the value to store. # The block should return the value to store.
# Subsequent calls will return the same value and not yield. # Subsequent calls will return the same value and not yield.
def get(&block : -> T) def get(&block : -> T)
if (value = @value) if (existing = @value)
value.get existing.get
else else
yield.tap do |value| yield.tap do |value|
@value = Value.new(value) @value = Value.new(value)