Skip to content

Commit

Permalink
Merge pull request #442 from torinnd/main
Browse files Browse the repository at this point in the history
Drop dependency on Async_find
  • Loading branch information
hannesm committed Nov 14, 2021
2 parents cfc0596 + 1b15ef5 commit b1ac0e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion async/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
(name tls_async)
(public_name tls-async)
(preprocess (pps ppx_jane))
(libraries async async_find core cstruct-async mirage-crypto-rng-async tls))
(libraries async core cstruct-async mirage-crypto-rng-async tls))
7 changes: 3 additions & 4 deletions async/x509_async.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ let file_contents file =

let load_all_in_directory ~directory ~f =
let open Deferred.Or_error.Let_syntax in
let options = Async_find.Options.ignore_errors in
let%bind files = Async_find.find_all ~options directory |> Deferred.ok in
Deferred.Or_error.List.map files ~f:(fun (file, (_ : Unix.Stats.t)) ->
let%bind contents = file_contents file in
let%bind files = Deferred.Or_error.try_with (fun () -> Sys.ls_dir directory) in
Deferred.Or_error.List.map files ~f:(fun file ->
let%bind contents = file_contents (directory ^/ file) in
f ~contents)
;;

Expand Down
1 change: 0 additions & 1 deletion tls-async.opam
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ depends: [
"x509" {>= "0.14.0"}
"ptime" {>= "0.8.1"}
"async" {>= "v0.14"}
"async_find" {>= "v0.14"}
"async_unix" {>= "v0.14"}
"core" {>= "v0.14"}
"cstruct-async"
Expand Down

0 comments on commit b1ac0e7

Please sign in to comment.