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

Add Lwt_bytes.{unsafe_,}blit_from_string #882

Merged
merged 5 commits into from
Sep 27, 2021

Conversation

hhugo
Copy link
Member

@hhugo hhugo commented Sep 13, 2021

Lwt_bytes was missing bliting from string.

  • add blit_from_string and unsafe_blit_from_string
  • update doc to make distinction between string and bytes
  • add tests for the new functions

src/unix/lwt_bytes.ml Outdated Show resolved Hide resolved
@raphael-proust
Copy link
Collaborator

Rebased on master where the CI is fixed

@raphael-proust raphael-proust self-requested a review September 20, 2021 06:31
@raphael-proust
Copy link
Collaborator

I pushed an additional commit which is only style: it replaces the following pattern

try
  let () = Lwt_bytes.… in
  Lwt.return_false
with
| Invalid_argument _ -> Lwt.return_true
| _ -> Lwt.return_true

with the following pattern

match Lwt_bytes.… with
| exception Invalid_argument _ -> Lwt.return_true
| () -> Lwt.return_false

(Also, it adds one test.)

We can roll it back if there are any issues with the test. @hhugo can you have a look at the commit?

@raphael-proust
Copy link
Collaborator

Probably the new pattern for tests is not compatible with old versions of OCaml so I'll revert it if the CI indicates so.

@raphael-proust raphael-proust merged commit 7136e4a into master Sep 27, 2021
@hhugo hhugo deleted the lwt_bytes-from_string branch September 27, 2021 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants