diff --git a/src/dune/file_tree.ml b/src/dune/file_tree.ml index fbd80dc3fa26..6528b0688141 100644 --- a/src/dune/file_tree.ml +++ b/src/dune/file_tree.ml @@ -2,31 +2,29 @@ open! Stdune open Import module File = struct - type t = - { ino : int - ; dev : int - } + module T = struct + type t = + { ino : int + ; dev : int + } - let to_dyn { ino; dev } = - let open Dyn.Encoder in - record [ ("ino", Int.to_dyn ino); ("dev", Int.to_dyn dev) ] + let to_dyn { ino; dev } = + let open Dyn.Encoder in + record [ ("ino", Int.to_dyn ino); ("dev", Int.to_dyn dev) ] - let compare a b = - match Int.compare a.ino b.ino with - | Eq -> Int.compare a.dev b.dev - | ne -> ne + let compare a b = + match Int.compare a.ino b.ino with + | Eq -> Int.compare a.dev b.dev + | ne -> ne + end + + include T let dummy = { ino = 0; dev = 0 } let of_stats (st : Unix.stats) = { ino = st.st_ino; dev = st.st_dev } - module Map = Map.Make (struct - type nonrec t = t - - let compare = compare - - let to_dyn _ = Dyn.opaque - end) + module Map = Map.Make (T) let of_source_path p = of_stats (Path.stat (Path.source p)) end