From 6e26862f40b25d32c8d7520e175ce37437f7f8c2 Mon Sep 17 00:00:00 2001 From: Jeltz Date: Tue, 30 Aug 2022 02:46:01 +0200 Subject: [PATCH] Replace record type with tuple for Match --- nftables.ml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/nftables.ml b/nftables.ml index b45ce83..984429c 100644 --- a/nftables.ml +++ b/nftables.ml @@ -35,12 +35,7 @@ type verdict = | Goto of string type _ stmt = - | Match : { - left : 'a expr; - right : 'b expr; - op : ('a, 'b) match_op; - } - -> unit stmt + | Match : (('a, 'b) match_op * 'a expr * 'b expr) -> unit stmt | Counter : counter -> unit stmt | Verdict : verdict -> unit stmt | NoTrack : unit stmt @@ -136,7 +131,7 @@ let json_of_verdict = function | Goto s -> assoc_one "goto" (assoc_one "target" (`String s)) let json_of_stmt : type a. a stmt -> Yojson.Basic.t = function - | Match { left; right; op } -> + | Match (op, left, right) -> assoc_one "match" (`Assoc [