Skip to content

Commit b674555

Browse files
authoredJun 19, 2020
Merge pull request #4 from bcardiff/crystal/0.35.1
Update IO#write return type
2 parents ff41acf + 7232f48 commit b674555

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed
 

‎src/rucksack.cr

+10-4
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,16 @@ class Rucksack
134134
raise NotImplementedError.new("")
135135
end
136136

137-
def write(slice : Bytes) : Int64
138-
@md.update(slice)
139-
slice.size.to_i64
140-
end
137+
{% if compare_versions(Crystal::VERSION, "0.35.0") == 0 %}
138+
def write(slice : Bytes) : Int64
139+
@md.update(slice)
140+
slice.size.to_i64
141+
end
142+
{% else %}
143+
def write(slice : Bytes) : Nil
144+
@md.update(slice)
145+
end
146+
{% end %}
141147

142148
def final
143149
@md.final

0 commit comments

Comments
 (0)