Fixing (Bool | Nil) union in the from_cbor.

master
Karchnu 2020-11-27 22:40:27 +01:00
parent a7eb538892
commit bd49ce7655
1 changed files with 0 additions and 2 deletions

View File

@ -218,7 +218,6 @@ end
def Union.new(decoder : CBOR::Decoder)
{% begin %}
case decoder.current_token
{% if T.includes? Nil || T.includes? Bool %}
when CBOR::Token::SimpleValueT
# This value could be either a boolean or nil.
value = decoder.read_simple_value
@ -234,7 +233,6 @@ def Union.new(decoder : CBOR::Decoder)
else
raise "value is neither Bool or Nil"
end
{% end %}
{% if T.includes? String %}
when CBOR::Token::StringT
return decoder.read_string