Skip to content

Commit 47cebca

Browse files
committed
replace deprecated Fmt.kstrf with Fmt.kstr
Signed-off-by: David Scott <[email protected]>
1 parent 129afb0 commit 47cebca

27 files changed

+84
-84
lines changed

src/bin/bind.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ open Vmnet
1010

1111
let is_windows = Sys.os_type = "Win32"
1212

13-
let failf fmt = Fmt.kstrf (fun e -> Lwt_result.fail (`Msg e)) fmt
13+
let failf fmt = Fmt.kstr (fun e -> Lwt_result.fail (`Msg e)) fmt
1414

1515
module Make(Socket: Sig.SOCKETS) = struct
1616

src/bin/connect.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module Unix = struct
3838
| Error e ->
3939
Log.err (fun f -> f "vsock connect write got %a" pp_write_error e);
4040
close flow >>= fun () ->
41-
Fmt.kstrf Lwt.fail_with "%a" pp_write_error e
41+
Fmt.kstr Lwt.fail_with "%a" pp_write_error e
4242
end
4343

4444
module Hvsock = struct

src/dns_forward/dns_forward_error.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ open Lwt.Infix
1818

1919
type 'a t = ('a, [ `Msg of string ]) Lwt_result.t
2020

21-
let errorf fmt = Fmt.kstrf (fun s -> Lwt.return (Error (`Msg s))) fmt
21+
let errorf fmt = Fmt.kstr (fun s -> Lwt.return (Error (`Msg s))) fmt
2222

2323
module FromFlowError(Flow: Mirage_flow.S) = struct
2424
let (>>=) m f = m >>= function

src/dns_mirage/dns_resolver_mirage.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ module Make(Time:Mirage_time.S)(S:Mirage_stack.V4) = struct
110110
let txfn buf =
111111
S.UDPV4.write ~src_port ~dst ~dst_port udp buf >>= function
112112
| Error e ->
113-
Fmt.kstrf fail_with
113+
Fmt.kstr fail_with
114114
"Attempting to communicate with remote resolver: %a"
115115
S.UDPV4.pp_error e
116116
| Ok () -> Lwt.return_unit

src/fs9p/fs9p.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let ok x = Lwt.return (Ok x)
1717

1818
let map_error x = Fs9p_error.map_error x
1919

20-
let error fmt = Fmt.kstrf (fun s -> Lwt.return (Fs9p_error.error "%s" s)) fmt
20+
let error fmt = Fmt.kstr (fun s -> Lwt.return (Fs9p_error.error "%s" s)) fmt
2121

2222
let err_not_a_dir name = error "%S is not a directory" name
2323

src/hostnet/capture.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module Make(Input: Sig.VMNET) = struct
1919
let lift_error = function
2020
| Ok x -> Ok x
2121
| Error (#Mirage_net.Net.error as e) -> Error e
22-
| Error e -> Fmt.kstrf (fun s -> Error (`Unknown s)) "%a" Input.pp_error e
22+
| Error e -> Fmt.kstr (fun s -> Error (`Unknown s)) "%a" Input.pp_error e
2323

2424
type packet = {
2525
id: int; (* unique id *)

src/hostnet/cohttp_mirage_io.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module Make (Channel: Mirage_channel.S) = struct
2727
type oc = Channel.t
2828
type conn = Channel.flow
2929

30-
let failf fmt = Fmt.kstrf Lwt.fail_with fmt
30+
let failf fmt = Fmt.kstr Lwt.fail_with fmt
3131

3232
let read_line ic =
3333
Channel.read_line ic >>= function

src/hostnet/filter.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module Make(Input: Sig.VMNET) = struct
1919
let lift_error = function
2020
| Ok x -> Ok x
2121
| Error (#Mirage_net.Net.error as e) -> Error e
22-
| Error e -> Fmt.kstrf (fun s -> Error (`Unknown s)) "%a" Input.pp_error e
22+
| Error e -> Fmt.kstr (fun s -> Error (`Unknown s)) "%a" Input.pp_error e
2323

2424
type t = {
2525
input: Input.t;

src/hostnet/forward.ml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ let set_allowed_addresses ips =
2525
));
2626
allowed_addresses := ips
2727

28-
let errorf fmt = Fmt.kstrf (fun e -> Error (`Msg e)) fmt
29-
let errorf' fmt = Fmt.kstrf (fun e -> Lwt.return (Error (`Msg e))) fmt
28+
let errorf fmt = Fmt.kstr (fun e -> Error (`Msg e)) fmt
29+
let errorf' fmt = Fmt.kstr (fun e -> Lwt.return (Error (`Msg e))) fmt
3030

3131
module Port = struct
3232
type t = Forwarder.Frame.Destination.t
3333

3434
let to_string = function
3535
| `Tcp (ip, port) ->
36-
Fmt.strf "tcp:%a:%d" Ipaddr.pp ip port
36+
Fmt.str "tcp:%a:%d" Ipaddr.pp ip port
3737
| `Udp (ip, port) ->
38-
Fmt.strf "udp:%a:%d" Ipaddr.pp ip port
38+
Fmt.str "udp:%a:%d" Ipaddr.pp ip port
3939
| `Unix path ->
40-
Fmt.strf "unix:%s" (Base64.encode_exn path)
40+
Fmt.str "unix:%s" (Base64.encode_exn path)
4141

4242
let of_string x =
4343
try
@@ -80,7 +80,7 @@ struct
8080
let get_key t = t.local
8181

8282
let to_string t =
83-
Fmt.strf "%s:%s" (Port.to_string t.local) (Port.to_string t.remote_port)
83+
Fmt.str "%s:%s" (Port.to_string t.local) (Port.to_string t.remote_port)
8484

8585
let description_of_format =
8686
"tcp:<local IP>:<local port>:tcp:<remote IP>:<remote port>
@@ -190,13 +190,13 @@ unix:<base64-encoded local path>:unix:<base64-encoded remote path>"
190190
let conn_read flow buf =
191191
Mux.Channel.read_into flow buf >>= function
192192
| Ok `Eof -> Lwt.fail End_of_file
193-
| Error e -> Fmt.kstrf Lwt.fail_with "%a" Mux.Channel.pp_error e
193+
| Error e -> Fmt.kstr Lwt.fail_with "%a" Mux.Channel.pp_error e
194194
| Ok (`Data ()) -> Lwt.return ()
195195

196196
let conn_write flow buf =
197197
Mux.Channel.write flow buf >>= function
198198
| Error `Closed -> Lwt.fail End_of_file
199-
| Error e -> Fmt.kstrf Lwt.fail_with "%a" Mux.Channel.pp_write_error e
199+
| Error e -> Fmt.kstr Lwt.fail_with "%a" Mux.Channel.pp_write_error e
200200
| Ok () -> Lwt.return ()
201201

202202
let start_udp_proxy description remote_port server =
@@ -293,7 +293,7 @@ unix:<base64-encoded local path>:unix:<base64-encoded remote path>"
293293
match t.local with
294294
| `Tcp (local_ip, local_port) ->
295295
let description =
296-
Fmt.strf "forwarding from tcp:%a:%d" Ipaddr.pp local_ip local_port
296+
Fmt.str "forwarding from tcp:%a:%d" Ipaddr.pp local_ip local_port
297297
in
298298
Lwt.catch (fun () ->
299299
check_bind_allowed local_ip >>= fun () ->
@@ -326,7 +326,7 @@ unix:<base64-encoded local path>:unix:<base64-encoded remote path>"
326326
)
327327
| `Udp (local_ip, local_port) ->
328328
let description =
329-
Fmt.strf "forwarding from udp:%a:%d" Ipaddr.pp local_ip local_port
329+
Fmt.str "forwarding from udp:%a:%d" Ipaddr.pp local_ip local_port
330330
in
331331
Lwt.catch (fun () ->
332332
check_bind_allowed local_ip >>= fun () ->
@@ -359,7 +359,7 @@ unix:<base64-encoded local path>:unix:<base64-encoded remote path>"
359359
)
360360
| `Unix path ->
361361
let description =
362-
Fmt.strf "forwarding from unix:%s" path
362+
Fmt.str "forwarding from unix:%s" path
363363
in
364364
Lwt.catch (fun () ->
365365
Socket.Stream.Unix.bind ~description path

src/hostnet/frame.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ let ( >>= ) m f = match m with
3131
| Ok x -> f x
3232
| Error x -> Error x
3333

34-
let errorf fmt = Fmt.kstrf (fun e -> Error (`Msg e)) fmt
34+
let errorf fmt = Fmt.kstr (fun e -> Error (`Msg e)) fmt
3535

3636
let need_space_for bufs n description =
3737
if Cstructs.len bufs < n

0 commit comments

Comments
 (0)