fn with_flush_propagate() {
    let mut sink = ManualFlush::new().with(|x| -> Result<Option<i32>, ()> { Ok(x) });
    flag_cx(|flag, cx| {
        assert!(sink.poll_ready(cx).unwrap().is_ready());
        sink.start_send(Some(0)).unwrap();
        assert!(sink.poll_ready(cx).unwrap().is_ready());
        sink.start_send(Some(1)).unwrap();

        let mut task = sink.flush();
        assert!(task.poll(cx).unwrap().is_pending());
        assert!(!flag.get());
        assert_eq!(task.get_mut().unwrap().get_mut().force_flush(), vec![0, 1]);
        assert!(flag.get());
        assert!(task.poll(cx).unwrap().is_ready());
    })
}
// test that the `with` sink doesn't require the underlying sink to flush,
// but doesn't claim to be flushed until the underlying sink is
test that the `with` sink doesn't require the underlying sink to flush,
but doesn't claim to be flushed until the underlying sink is
test that the ` with ` sink doesn ' t require the underlying sink to flush but doesn ' t claim to be flushed until the underlying sink is
fn with_flush_propagate() {
    let mut sink = ManualFlush::new().with(|x| -> Result<Option<i32>, ()> { Ok(x) });
    flag_cx(|flag, cx| {
        assert!(sink.poll_ready(cx).unwrap().is_ready());
        sink.start_send(Some(0)).unwrap();
        assert!(sink.poll_ready(cx).unwrap().is_ready());
        sink.start_send(Some(1)).unwrap();
        let mut task = sink.flush();
        assert!(task.poll(cx).unwrap().is_pending());
        assert!(!flag.get());
        assert_eq!(task.get_mut().unwrap().get_mut().force_flush(), vec![0, 1]);
        assert!(flag.get());
        assert!(task.poll(cx).unwrap().is_ready());
    })
}
fn with_flush_propagate ( ) { let mut sink = ManualFlush :: new ( ) . with ( | x | -> Result < Option < i32 > , ( ) > { Ok ( x ) } ) ; flag_cx ( | flag , cx | { assert ! ( sink poll_ready ( cx ) unwrap ( ) is_ready ( ) ) ; sink . start_send ( Some ( 0 ) ) . unwrap ( ) ; assert ! ( sink poll_ready ( cx ) unwrap ( ) is_ready ( ) ) ; sink . start_send ( Some ( 1 ) ) . unwrap ( ) ; let mut task = sink . flush ( ) ; assert ! ( task poll ( cx ) unwrap ( ) is_pending ( ) ) ; assert ! ( flag get ( ) ) ; assert_eq ! ( task get_mut ( ) unwrap ( ) get_mut ( ) force_flush ( ) vec [ 0 1 ] ) ; assert ! ( flag get ( ) ) ; assert ! ( task poll ( cx ) unwrap ( ) is_ready ( ) ) ; } ) }
test that the `with` sink doesn't require the underlying sink to flush,
but doesn't claim to be flushed until the underlying sink is
test that the ` with ` sink doesn ' t require the underlying sink to flush but doesn ' t claim to be flushed until the underlying sink is