type annotation

This commit is contained in:
Mylloon 2023-06-19 20:30:47 +02:00
parent d4374ac2da
commit 10347ad517
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -1,7 +1,7 @@
open Types
open Utils
let parse_header reader =
let parse_header (reader : reader) =
let max_size = 6 in
match List.init max_size (fun offset -> unpack_short_be reader.data (offset * 2)) with
| [ id; flags; num_questions; num_answers; num_authorities; num_additionals ] ->
@ -10,7 +10,7 @@ let parse_header reader =
| _ -> failwith "Invalid number of fields"
;;
let rec parse_question reader =
let rec parse_question (reader : reader) =
let name, offset_name = decode_name reader in
let data = bytes_forward reader.data (reader.pointer + offset_name) in
let max_size = 2 in