Commit 3df09470 authored by Raphaël Proust's avatar Raphaël Proust Committed by Romain

Stdlib: minor improvement for pipes

parent df5d757f
Pipeline #107474572 passed with stages
in 29 minutes and 33 seconds
......@@ -127,7 +127,7 @@ exception Full
let push_now_exn q elt = if not (push_now q elt) then raise Full
let safe_push_now q elt = try push_now_exn q elt with _ -> ()
let safe_push_now q elt = try push_now_exn q elt with Full | Closed -> ()
let rec pop ({closed; queue; empty; current_size; _} as q) =
if not (Queue.is_empty queue) then (
......
......@@ -90,7 +90,8 @@ exception Full
@raise [Full] if [q] does not have enough space to hold [v]. *)
val push_now_exn : 'a t -> 'a -> unit
(** [safe_push_now q v] may or may not add [v] at the ends of [q]. *)
(** [safe_push_now q v] adds [v] to [q] if [q] is not [Closed] and has enough
space available, otherwise it does nothing. *)
val safe_push_now : 'a t -> 'a -> unit
(** [pop_now q] may remove and return the first element in [q] if
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment