Skip to content

Commit

Permalink
feat: relax enum parsing
Browse files Browse the repository at this point in the history
so it doesn't raise an error if i encounters an unknown value
  • Loading branch information
stakach committed Sep 22, 2020
1 parent 4ebc6bd commit c1ace07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: bindata
version: 1.6.0
version: 1.7.0

development_dependencies:
ameba:
Expand Down
2 changes: 1 addition & 1 deletion src/bindata.cr
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ abstract class BinData

{% elsif part[:type] == "enum" %}
%value = io.read_bytes({{part[:cls]}}, __format__).to_i
@{{part[:name]}} = {{part[:encoding]}}.from_value(%value)
@{{part[:name]}} = {{part[:encoding]}}.new(%value)

{% elsif part[:type] == "group" %}
@{{part[:name]}} = {{part[:cls]}}.new
Expand Down

0 comments on commit c1ace07

Please sign in to comment.