✓
Passing This code compiles and runs correctly.
Code
// std/rings — `dequeue | none` is the empty answer, not an error: a
// consumer that finds nothing fires none and decides for itself whether
// to wait, poll again, or move on.
import std/rings
import std/io
std/rings:new(q, capacity: 4) { value: u64 }
std/rings:dequeue(q)
| some v |> std/io:print.ln("ERROR: got {{ v:d }}")
| none |> std/io:print.ln("none on empty")
Actual
none on empty
Expected output
none on empty
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (q, capacity: 4, source: value: u64)
flow ~dequeue click a branch to expand · @labels scroll to their anchor
dequeue (q)
Test Configuration
MUST_RUN