Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove Modules.is_empty #6564

Merged
merged 1 commit into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/dune_rules/modules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ module Wrapped = struct
; wrapped : Mode.t
}

let empty t = Module_name.Map.is_empty t.modules

let encode
{ modules; wrapped_compat; alias_module; main_module_name; wrapped } =
let open Dune_lang.Encoder in
Expand Down Expand Up @@ -774,11 +772,6 @@ let relocate_alias_module t ~src_dir =
| Wrapped t -> Wrapped (Wrapped.relocate_alias_module t ~src_dir)
| s -> s

let is_empty = function
| Stdlib _ | Impl _ | Singleton _ -> false
| Unwrapped w -> Module_name.Map.is_empty w
| Wrapped w -> Wrapped.empty w

let as_singleton = function
| Singleton m -> Some m
| _ -> None
Expand Down
2 changes: 0 additions & 2 deletions src/dune_rules/modules.mli
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ val exit_module : t -> Module.t option
module to [src_dir]. Only works if [t] is wrapped. *)
val relocate_alias_module : t -> src_dir:Path.t -> t

val is_empty : t -> bool

val as_singleton : t -> Module.t option

val source_dirs : t -> Path.Set.t
Expand Down