Skip to content

Commit

Permalink
Replace another use of int_of_string
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg committed Oct 30, 2019
1 parent 88f95fb commit e603cd7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/dune_manager/utils.ml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
open Stdune

let int_of_string ?where s =
try Result.Ok (int_of_string s)
with Failure _ ->
match Int.of_string s with
| Some s -> Ok s
| None ->
Result.Error
(Printf.sprintf "invalid integer%s: %s"
( match where with
Expand Down
2 changes: 1 addition & 1 deletion src/stdune/list.ml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ let unzip l =
fold_right ~init:([], []) ~f:(fun (x, y) (xs, ys) -> (x :: xs, y :: ys)) l

let rec for_all2 x y ~f =
match x, y with
match (x, y) with
| [], [] -> Ok true
| x :: xs, y :: ys ->
if f x y then
Expand Down

0 comments on commit e603cd7

Please sign in to comment.