Skip to content

Commit b146a38

Browse files
committed
style: Format
1 parent 437192e commit b146a38

File tree

16 files changed

+11
-29
lines changed

16 files changed

+11
-29
lines changed

spec/binary_parser_spec.cr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,3 @@ describe BinaryParser do
7575
end
7676
end
7777
end
78-

spec/fixture/array.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require "../../src/binary_parser"
22

33
class FixedArrayParser < BinaryParser
4-
array :arr, { type: UInt8, count: 5 }
4+
array :arr, {type: UInt8, count: 5}
55
end
66

77
FixedArrayFixture = IO::Memory.new(sizeof(UInt8) * 5)
@@ -12,7 +12,7 @@ FixedArrayFixture.rewind
1212

1313
class VarArrayParser < BinaryParser
1414
uint32 :size
15-
array :arr, { type: UInt8, count: :size }
15+
array :arr, {type: UInt8, count: :size}
1616
end
1717

1818
VarArrayFixture = IO::Memory.new(sizeof(UInt32) + sizeof(UInt8) * 5)

spec/fixture/byte_size.cr

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ class ByteSizeFixture < BinaryParser
44
uint8 :foo
55
uint32 :bar
66
uint32 :size
7-
string :str, { count: :size }
8-
array :arr, { count: :size, type: UInt8 }
7+
string :str, {count: :size}
8+
array :arr, {count: :size, type: UInt8}
99
include BinaryParser::ByteSize
1010
end
11-

spec/spec_helper.cr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
require "spec"
22
require "expect"
33
require "../src/binary_parser"
4-

src/binary_parser.cr

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ require "./binary_parser/macros/*"
1616
# ```
1717
#
1818
class BinaryParser
19-
2019
# Load from file with `filename`
2120
#
2221
def load(filename : String)
@@ -80,4 +79,3 @@ class BinaryParser
8079
end
8180

8281
require "./binary_parser/byte_size"
83-

src/binary_parser/byte_size.cr

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class BinaryParser
2-
32
# Calculate bytesize support
43
#
54
# ```crystal
@@ -11,7 +10,6 @@ class BinaryParser
1110
#
1211
# parser = Parser.new
1312
# parser.bytesize # sizeof(UInt8) * 2
14-
#
1513
# ```
1614
#
1715
module ByteSize

src/binary_parser/macros/array.cr

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class BinaryParser
2-
32
# Declare an array field
43
#
54
# ### Argument:
@@ -12,18 +11,18 @@ class BinaryParser
1211
# ```crystal
1312
# # Fixed size
1413
# class Parser < BinaryParser
15-
# array :arr, { type: UInt8, count: 10 } # Array of 10 UInt8
14+
# array :arr, {type: UInt8, count: 10} # Array of 10 UInt8
1615
# end
1716
#
1817
# # Variable size
1918
# class Parser < BinaryParser
2019
# uint32 :size
21-
# array :arr, { type: UInt8, count: :size }
20+
# array :arr, {type: UInt8, count: :size}
2221
# end
2322
# ```
2423
#
2524
macro array(name, opt)
26-
{% raise "Must have count and type" unless opt[:type] && opt[:count] %}
25+
{% raise "Must have count and type" unless opt[:type] && opt[:count] %}
2726
property! :{{name.id}}
2827
@{{name.id}} = [] of {{opt[:type]}}
2928

src/binary_parser/macros/int32.cr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class BinaryParser
2-
32
# Declare a int32 field
43
#
54
# ```crystal

src/binary_parser/macros/int64.cr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class BinaryParser
2-
32
# Declare a int64 field
43
#
54
# ```crystal

src/binary_parser/macros/int8.cr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class BinaryParser
2-
32
# Declare a int8 field
43
#
54
# ```crystal

0 commit comments

Comments
 (0)