Source file mime_version.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
type t = Rfc2045.version

let pp = Fmt.Dump.pair Fmt.int Fmt.int

let default = (1, 0)

module Encoder = struct
  open Encoder

  external id : 'a -> 'a = "%identity"

  let int = using string_of_int string

  let mime_version ppf (a, b) =
    eval ppf [ !!int; char $ '.'; !!int ] a b
end