Skip to content

Commit

Permalink
Merge pull request #53 from inhabitedtype/of_string
Browse files Browse the repository at this point in the history
of_string: simplify bigstring_of_string impl in tests
  • Loading branch information
seliopou authored Aug 11, 2019
2 parents 515a397 + 631c419 commit 8bd31ee
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib_test/test_faraday.ml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
open Faraday

let bigstring_of_string str =
let len = String.length str in
let buf = Bigarray.(Array1.create char c_layout len) in
for i = 0 to len - 1 do
Bigarray.Array1.unsafe_set buf i (String.unsafe_get str i)
done;
buf
Bigstringaf.of_string ~off:0 ~len:(String.length str) str

let string_of_bigstring b =
Bigstringaf.substring ~off:0 ~len:(Bigstringaf.length b) b
Expand Down

0 comments on commit 8bd31ee

Please sign in to comment.