Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Bytes.unsafe_blit_string #6933

Closed
vicuna opened this issue Jul 19, 2015 · 2 comments
Closed

Export Bytes.unsafe_blit_string #6933

vicuna opened this issue Jul 19, 2015 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Jul 19, 2015

Original bug ID: 6933
Reporter: @dbuenzli
Status: closed (set by @xavierleroy on 2017-02-16T14:15:08Z)
Resolution: won't fix
Priority: normal
Severity: feature
Version: 4.02.2
Category: standard library

Bug description

It would be nice to export the function is Bytes.mli. This may need coordination with ocamlfind's magic bytes package though.

@vicuna
Copy link
Author

vicuna commented Jul 20, 2015

Comment author: @dbuenzli

I overlooked the fact that both Bytes.unsafe_blit and Bytes.unsafe_blit_string are backed by the same C primitive. So Bytes.unsafe_blit_string can be written:

let unsafe_blit_string s s0 d d0 len = Bytes.(unsafe_blit (unsafe_of_string s) s0 d d0 len)

Feel free to close the PR it's not worth the hassle.

@vicuna
Copy link
Author

vicuna commented Jul 22, 2015

Comment author: @damiendoligez

Since we are talking about an unsafe function, I think a little verbosity is good if it makes people hesitate to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant