schovi / baked_file_system

Virtual File System for Crystal language. Embedding your assets into final binary.
MIT License
177 stars 18 forks source link

Upgrade to Crystal 0.35.0 #36

Closed straight-shoota closed 4 years ago

straight-shoota commented 4 years ago

These changes are required to make this shard work with Crystal 0.35.0

da1nerd commented 4 years ago

I literally just sat down to open a PR for this. :+1:

carlhoerberg commented 4 years ago

Yes it would, the reason for returning the number of bytes actually written is to make more efficient position accounting, that is not having to call pos on the underlying IO.

On Thu, 11 Jun 2020, 01:29 Johannes Müller, notifications@github.com wrote:

@straight-shoota commented on this pull request.

In src/loader/string_encoder.cr https://github.com/schovi/baked_file_system/pull/36#discussion_r438461537 :

@@ -39,5 +39,7 @@ class BakedFileSystem::StringEncoder < IO byte.to_s(16, @io, upcase: true) end end +

  • slice.size.to_i64

I think that's correct. At least it's the same in stdlib implementations. The return value is supposed to be the number of bytes written from the input. Not how many bytes are passed on to the wrapped IO. That wouldn't have any meaning at all in the caller context.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/schovi/baked_file_system/pull/36#discussion_r438461537, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABL6TVYFM5DNIUS2347CRLRWAJMZANCNFSM4NZZBAVA .

straight-shoota commented 4 years ago

This PR is obsolete with the release of Crystal 0.35.1.