Skip to content

Commit

Permalink
refactor(pkg): inline one off function
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

<!-- ps-id: d9854eff-55b2-4c3a-b979-aedb726ffd4d -->
  • Loading branch information
rgrinberg committed May 15, 2024
1 parent 29eecf2 commit 426950f
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/dune_pkg/package_universe.ml
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,6 @@ let create local_packages lock_dir =
t
;;
let concrete_dependencies_of_local_package_with_test t local_package_name =
match concrete_dependencies_of_local_package_with_test t local_package_name with
| Ok x -> x
| Error e ->
Code_error.raise
"Invalid package universe which should have already been validated"
[ "error", Dyn.string (User_message.to_string e) ]
;;
let concrete_dependencies_of_local_package_without_test t local_package_name =
let local_package = Package_name.Map.find_exn t.local_packages local_package_name in
Local_package.(for_solver local_package |> For_solver.opam_filtered_dependency_formula)
Expand Down Expand Up @@ -303,7 +294,14 @@ let check_contains_package t package_name =
let all_dependencies t package ~traverse =
check_contains_package t package;
let immediate_deps = concrete_dependencies_of_local_package_with_test t package in
let immediate_deps =
match concrete_dependencies_of_local_package_with_test t package with
| Ok x -> x
| Error e ->
Code_error.raise
"Invalid package universe which should have already been validated"
[ "error", Dyn.string (User_message.to_string e) ]
in
match traverse with
| `Immediate -> immediate_deps
| `Transitive ->
Expand Down

0 comments on commit 426950f

Please sign in to comment.