Skip to content

Commit ab6e68e

Browse files
authored
refactor: add type equality to remove pointless conversion (#11392)
Signed-off-by: Rudi Grinberg <[email protected]>
1 parent b4bf4b9 commit ab6e68e

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

src/dune_lang/action.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ end
7070

7171
module Env_update = struct
7272
module Op = struct
73-
type t =
73+
type t = OpamParserTypes.env_update_op =
7474
| Eq
7575
| PlusEq
7676
| EqPlus

src/dune_lang/action.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ end
6666

6767
module Env_update : sig
6868
module Op : sig
69-
type t =
69+
type t = OpamParserTypes.env_update_op =
7070
| Eq
7171
| PlusEq
7272
| EqPlus

src/dune_pkg/opam_solver.ml

+2-11
Original file line numberDiff line numberDiff line change
@@ -1536,17 +1536,8 @@ let opam_commands_to_actions
15361536
Some action))
15371537
;;
15381538

1539-
let opam_env_update_to_env_update ((var, env_op, value_string, _) : OpamTypes.env_update)
1540-
: String_with_vars.t Action.Env_update.t
1541-
=
1542-
{ Action.Env_update.op =
1543-
(match (env_op : OpamParserTypes.env_update_op) with
1544-
| Eq -> Eq
1545-
| PlusEq -> PlusEq
1546-
| EqPlus -> EqPlus
1547-
| ColonEq -> ColonEq
1548-
| EqColon -> EqColon
1549-
| EqPlusEq -> EqPlusEq)
1539+
let opam_env_update_to_env_update (var, env_op, value_string, _) : _ Action.Env_update.t =
1540+
{ Action.Env_update.op = env_op
15501541
; var
15511542
; value = String_with_vars.make_text Loc.none value_string
15521543
}

0 commit comments

Comments
 (0)