From 5b275f31464f5e83d0222dea1c9e443efb1157bd Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Wed, 12 Sep 2018 20:28:36 -0600 Subject: [PATCH] Use #unsafe_as The value can't be any other type, so this should be a safe operation. --- src/spectator/dsl.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spectator/dsl.cr b/src/spectator/dsl.cr index 65c7e06..ac2bdd9 100644 --- a/src/spectator/dsl.cr +++ b/src/spectator/dsl.cr @@ -82,7 +82,7 @@ module Spectator def {{name.id}} if (wrapper = @%wrapper) - wrapper.as(TypedValueWrapper(typeof(%value))).value + wrapper.unsafe_as(TypedValueWrapper(typeof(%value))).value else %value.tap do |value| @%wrapper = TypedValueWrapper(typeof(%value)).new(value)