aboutsummaryrefslogtreecommitdiff
path: root/lib/segment.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/segment.ml')
-rw-r--r--lib/segment.ml8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/segment.ml b/lib/segment.ml
index 7023098..b278c50 100644
--- a/lib/segment.ml
+++ b/lib/segment.ml
@@ -1,4 +1,4 @@
-open Lwt.Syntax
+open Lwt.Infix
open Markup
open Xml
@@ -15,8 +15,4 @@ 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
- let* el = tree signal
- in match el with
- | Some xml -> Lwt.return xml
- | None -> Lwt.fail (InvalidStanza (signal |> write_xml |> to_string))
+ next stream >>= tree