let dequeue_with_key_exn t =
    match dequeue_with_key t with
    | None -> raise Not_found
    | Some (k, v) -> (k, v)