From a721d9aed3fb2c2399267638bd50fa20bfd84290 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 25 Jan 2022 12:27:46 -0500 Subject: [PATCH] minor style changes --- src/core/CCResult.ml | 6 ++++-- src/core/CCResult.mli | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/CCResult.ml b/src/core/CCResult.ml index 1a49efdb..90e6159d 100644 --- a/src/core/CCResult.ml +++ b/src/core/CCResult.ml @@ -70,9 +70,11 @@ let of_exn_trace e = let opt_map f e = match e with | None -> Ok None - | Some x -> (match f x with + | Some x -> + begin match f x with | Ok x -> Ok (Some x) - | Error e -> Error e) + | Error e -> Error e + end let map f e = match e with | Ok x -> Ok (f x) diff --git a/src/core/CCResult.mli b/src/core/CCResult.mli index 192a6f96..78f21ef8 100644 --- a/src/core/CCResult.mli +++ b/src/core/CCResult.mli @@ -64,7 +64,8 @@ val add_ctxf : ('a, Format.formatter, unit, ('b, string) t -> ('b, string) t) fo @since 1.2 *) val opt_map : ('a -> ('b, 'c) t) -> 'a option -> ('b option, 'c) t -(** Map optional success *) +(** Map a fallible operation through an option. + @since NEXT_RELEASE *) val map : ('a -> 'b) -> ('a, 'err) t -> ('b, 'err) t (** Map on success. *)