diff options
author | Clombrong <cromblong@egregore.fun> | 2025-08-16 00:42:18 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-08-16 00:42:18 +0200 |
commit | ef054dfae34971a28811c5082a4b6041bdfe58dd (patch) | |
tree | c17bb8836b0aa6bc9b3a989510e9b13076acbf9f /lib/segment.ml | |
parent | 96855075812e692cd4ae099f0d27964e306f0f2b (diff) |
feat(xml): make tree function async
Diffstat (limited to 'lib/segment.ml')
-rw-r--r-- | lib/segment.ml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/segment.ml b/lib/segment.ml index ce50f78..7023098 100644 --- a/lib/segment.ml +++ b/lib/segment.ml @@ -15,7 +15,8 @@ let next (stream : (signal, async) stream) : (signal, sync) stream Lwt.t = (** [get stream] is a promise containing a single Xml element of [stream]. *) let get (stream : (signal, async) stream) : element Lwt.t = - let* signal = next stream - in match tree signal with + let* signal = next stream in + let* el = tree signal + in match el with | Some xml -> Lwt.return xml | None -> Lwt.fail (InvalidStanza (signal |> write_xml |> to_string)) |