Skip to content

Add Lwt_bytes.{unsafe_,}blit_from_string - #882

Merged
raphael-proust merged 5 commits into
masterfrom
lwt_bytes-from_string
Sep 27, 2021
Merged

raphael-proust merged 5 commits into
masterfrom
lwt_bytes-from_string

Conversation

@hhugo

@hhugo hhugo commented Sep 13, 2021

Copy link
Copy Markdown
Member

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

Comment thread src/unix/lwt_bytes.ml Resolved
@raphael-proust

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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