···2929 List.iter
3030 (fun e ->
3131 let k = match e.kind with Dev -> "dev" | Std -> "std" in
3232- Buffer.add_string buf
3333- (Printf.sprintf "%s %s\n" k (Fpath.to_string e.path)))
3232+ Buffer.add_string buf (Fmt.str "%s %s\n" k (Fpath.to_string e.path)))
3433 t.entries;
3534 Buffer.contents buf
3635···5150 { entries = List.filter (fun e -> not (Fpath.equal e.path path)) t.entries }
52515352let entries t = t.entries
5353+5454+let pp_kind ppf = function
5555+ | Dev -> Fmt.string ppf "dev"
5656+ | Std -> Fmt.string ppf "std"
5757+5858+let pp_entry ppf e = Fmt.pf ppf "%a %a" pp_kind e.kind Fpath.pp e.path
5959+let pp ppf t = Fmt.pf ppf "@[<v>%a@]" Fmt.(list ~sep:Fmt.cut pp_entry) t.entries
+3
ocaml-claude-skills/lib/config.mli
···45454646val entries : t -> entry list
4747(** Return all entries in file order. *)
4848+4949+val pp : t Fmt.t
5050+(** Pretty-print the configuration. *)
+2-2
ocaml-slack/test/test_markdown.ml
···9595 (fun input ->
9696 let once = to_mrkdwn input in
9797 let twice = input |> to_mrkdwn |> to_md |> to_mrkdwn in
9898- check (Printf.sprintf "md roundtrip: %s" input) once twice)
9898+ check (Fmt.str "md roundtrip: %s" input) once twice)
9999 inputs
100100101101let test_roundtrip_mrkdwn () =
···114114 (fun input ->
115115 let once = to_md input in
116116 let twice = input |> to_md |> to_mrkdwn |> to_md in
117117- check (Printf.sprintf "mrkdwn roundtrip: %s" input) once twice)
117117+ check (Fmt.str "mrkdwn roundtrip: %s" input) once twice)
118118 inputs
119119120120let suite =
+3-3
ocaml-sle/fuzz/fuzz_bind.ml
···3535 | 1 -> Sle.Bind.Bind_pending
3636 | _ -> Sle.Bind.Bound
3737 in
3838- let _ = Format.asprintf "%a" Sle.Bind.pp_state state in
3838+ let _ = Fmt.str "%a" Sle.Bind.pp_state state in
3939 ()
40404141(** Pretty-print service type - must not crash. *)
···4747 | 2 -> Sle.Bind.Fcltu
4848 | _ -> Sle.Bind.Rocf
4949 in
5050- let _ = Format.asprintf "%a" Sle.Bind.pp_service_type st in
5050+ let _ = Fmt.str "%a" Sle.Bind.pp_service_type st in
5151 ()
52525353(** Pretty-print bind diagnostic - must not crash. *)
···6060 | 3 -> Sle.Bind.No_such_service_instance
6161 | _ -> Sle.Bind.Other_reason
6262 in
6363- let _ = Format.asprintf "%a" Sle.Bind.pp_diagnostic diag in
6363+ let _ = Fmt.str "%a" Sle.Bind.pp_diagnostic diag in
6464 ()
65656666let suite =
+2-2
ocaml-sle/fuzz/fuzz_common.ml
···6565 | 4 -> Sle.Common.Forward_offline
6666 | n -> Sle.Common.Unknown_delivery_mode n
6767 in
6868- let _ = Format.asprintf "%a" Sle.Common.pp_delivery_mode d in
6868+ let _ = Fmt.str "%a" Sle.Common.pp_delivery_mode d in
6969 ()
70707171(** Pretty-print frame quality - must not crash. *)
···7777 | 2 -> Sle.Common.Undetermined
7878 | n -> Sle.Common.Unknown_frame_quality n
7979 in
8080- let _ = Format.asprintf "%a" Sle.Common.pp_frame_quality q in
8080+ let _ = Fmt.str "%a" Sle.Common.pp_frame_quality q in
8181 ()
82828383let suite =
+1-1
ocaml-sle/fuzz/fuzz_isp1.ml
···4141(** Pretty-print hash algorithm - must not crash. *)
4242let test_pp_hash_algorithm n =
4343 let algo = if n mod 2 = 0 then Sle.Isp1.Sha1 else Sle.Isp1.Sha256 in
4444- let _ = Format.asprintf "%a" Sle.Isp1.pp_hash_algorithm algo in
4444+ let _ = Fmt.str "%a" Sle.Isp1.pp_hash_algorithm algo in
4545 ()
46464747let suite =
+3-3
ocaml-sle/fuzz/fuzz_raf.ml
···4848 | 1 -> Sle.Raf.Active
4949 | _ -> Sle.Raf.Stopping
5050 in
5151- let _ = Format.asprintf "%a" Sle.Raf.pp_state state in
5151+ let _ = Fmt.str "%a" Sle.Raf.pp_state state in
5252 ()
53535454(** Pretty-print start diagnostic - must not crash. *)
···6262 | 4 -> Sle.Raf.Out_of_service_start
6363 | _ -> Sle.Raf.Duplicate_invoke_id_start
6464 in
6565- let _ = Format.asprintf "%a" Sle.Raf.pp_start_diagnostic diag in
6565+ let _ = Fmt.str "%a" Sle.Raf.pp_start_diagnostic diag in
6666 ()
67676868(** Pretty-print frame quality - must not crash. *)
···7474 | 2 -> Sle.Raf.Undetermined
7575 | _ -> Sle.Raf.Unknown_frame_quality n
7676 in
7777- let _ = Format.asprintf "%a" Sle.Raf.pp_frame_quality q in
7777+ let _ = Fmt.str "%a" Sle.Raf.pp_frame_quality q in
7878 ()
79798080let suite =
+2-2
ocaml-sle/fuzz/fuzz_tml.ml
···6969 | _ -> Sle.Tml.Heartbeat
7070 in
7171 let msg = { Sle.Tml.msg_type; payload = Bytes.unsafe_of_string payload } in
7272- let _ = Format.asprintf "%a" Sle.Tml.pp_message msg in
7272+ let _ = Fmt.str "%a" Sle.Tml.pp_message msg in
7373 ()
74747575(** Pretty-print context - must not crash. *)
7676let test_pp_context protocol_id version heartbeat_interval dead_factor =
7777 let ctx = { Sle.Tml.protocol_id; version; heartbeat_interval; dead_factor } in
7878- let _ = Format.asprintf "%a" Sle.Tml.pp_context ctx in
7878+ let _ = Fmt.str "%a" Sle.Tml.pp_context ctx in
7979 ()
80808181let suite =
···112112 | Ok p -> p
113113 | Error _ -> failwith "negate: invalid result"
114114115115+ let err_ec e = Error (Fmt.str "%a" Crypto_ec.pp_error e)
116116+115117 let of_bytes s =
116116- match Ec.of_octets s with
117117- | Ok p -> Ok p
118118- | Error e -> Error (Fmt.str "%a" Crypto_ec.pp_error e)
118118+ match Ec.of_octets s with Ok p -> Ok p | Error e -> err_ec e
119119120120 (** Convert a scalar represented as Z.t to the constant-time scalar type *)
121121 let scalar_of_z z =