diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-10-10 02:14:55 +0000 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-10-10 02:14:55 +0000 |
| commit | 6201bbc6e7171f037467bbfc2d0a6da084fb516c (patch) | |
| tree | adbe90a81ebc6b732e83fcbdc10b5ca8eb55297b /lib/kernel | |
| parent | c19a5169c5fcbfba5546f49d6d4d0b0e29d40e3a (diff) | |
| download | RNT-6201bbc6e7171f037467bbfc2d0a6da084fb516c.tar.gz RNT-6201bbc6e7171f037467bbfc2d0a6da084fb516c.zip | |
Make the autorelease pool opt-in
Diffstat (limited to '')
| -rw-r--r-- | lib/kernel/Path.ml | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/kernel/Path.ml b/lib/kernel/Path.ml index 8822d44..a2e270e 100644 --- a/lib/kernel/Path.ml +++ b/lib/kernel/Path.ml @@ -21,18 +21,17 @@ end let walking f g handle path = let open Protocols in + let open Utilities.Result in let rec walk handle = function | [] -> - Handle.keep handle; - g handle + g (Handle.keep handle) | x :: xs -> ( - let open Utilities.Result in let* dir = Handle.require Directory.from handle |> Result.map_error Concepts.Condition.(complement ("before-segment" |=| Concepts.Value.String x)) in - let* elem = Directory.find dir x in + let* elem = Directory.find dir x |> Result.map (Option.map Handle.autorelease) in match elem with | None -> Error (Error.path_not_found path) | Some elem -> f x handle (fun () -> walk elem xs) ) |
