OCaml implementation of the Mozilla Public Suffix service
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(lint): replace Printf/Format with Fmt across remaining packages

Migrate Printf.sprintf to Fmt.str, Format.fprintf to Fmt.pf, and
Format.pp_print_string to Fmt.string across bundle, gpt, hap, homebrew,
jsonwt, matter, mbr, meross, paseto, precommit, publicsuffix, qemu,
retry, sdnv, slack, sle, space-packet, spake2, sqlite, squashfs, tar,
tc, tcf, tcpcl, tm, tomlt, tty, uslp, vlog, wal, wire, yamlrw, yamlt,
osrelease, space, xdge, and crypto test runner.

+9 -10
+1 -1
lib/dune
··· 16 16 (library 17 17 (name publicsuffix) 18 18 (public_name publicsuffix) 19 - (libraries domain-name punycode.idna publicsuffix.data) 19 + (libraries domain-name fmt punycode.idna publicsuffix.data) 20 20 (modules publicsuffix))
+8 -9
lib/publicsuffix.ml
··· 35 35 | Domain_is_public_suffix 36 36 37 37 let pp_error fmt = function 38 - | Empty_domain -> Format.fprintf fmt "Empty domain" 39 - | Invalid_domain s -> Format.fprintf fmt "Invalid domain: %s" s 40 - | Leading_dot -> Format.fprintf fmt "Domain has a leading dot" 41 - | Punycode_error s -> Format.fprintf fmt "Punycode conversion error: %s" s 42 - | No_public_suffix -> Format.fprintf fmt "No public suffix found" 43 - | Domain_is_public_suffix -> 44 - Format.fprintf fmt "Domain is itself a public suffix" 38 + | Empty_domain -> Fmt.pf fmt "Empty domain" 39 + | Invalid_domain s -> Fmt.pf fmt "Invalid domain: %s" s 40 + | Leading_dot -> Fmt.pf fmt "Domain has a leading dot" 41 + | Punycode_error s -> Fmt.pf fmt "Punycode conversion error: %s" s 42 + | No_public_suffix -> Fmt.pf fmt "No public suffix found" 43 + | Domain_is_public_suffix -> Fmt.pf fmt "Domain is itself a public suffix" 45 44 46 - let error_to_string err = Format.asprintf "%a" pp_error err 45 + let error_to_string err = Fmt.str "%a" pp_error err 47 46 let create () = { root = Publicsuffix_data.get_root () } 48 47 49 48 (* Find a child node by label (case-insensitive) *) ··· 155 154 match 156 155 try Ok (Punycode_idna.to_ascii domain) 157 156 with Punycode_idna.Error e -> 158 - let msg = Format.asprintf "%a" Punycode_idna.pp_error_reason e in 157 + let msg = Fmt.str "%a" Punycode_idna.pp_error_reason e in 159 158 Error (Punycode_error msg) 160 159 with 161 160 | Error e -> Error e