diff --git a/src/dune_cache/local.ml b/src/dune_cache/local.ml index 0db6f16c8f6..6e9aeab14af 100644 --- a/src/dune_cache/local.ml +++ b/src/dune_cache/local.ml @@ -198,16 +198,8 @@ module Artifacts = struct let result = store_metadata ~mode ~rule_digest ~metadata:[] artifacts in Store_artifacts_result.of_store_result ~artifacts result) - let rec fold_list_result l ~init ~f = - match l with - | [] -> Ok init - | x :: xs -> ( - match f init x with - | Ok acc -> fold_list_result xs ~init:acc ~f - | Error e -> Error e) - let create_all_or_nothing ~create ~destroy list = - fold_list_result list ~init:[] ~f:(fun acc x -> + Result.List.fold_left list ~init:[] ~f:(fun acc x -> match create x with | Error e -> List.iter acc ~f:destroy;