File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -744,26 +744,34 @@ mod tests {
744
744
. input
745
745
. chain ( builder)
746
746
. map_block ( add)
747
+ . map_block ( print_debug ( format ! ( "line {}" , line!( ) ) ) )
747
748
. then_scope :: < _ , ( ) > ( ScopeSettings :: default ( ) , |scope, builder| {
748
749
scope
749
750
. input
750
751
. chain ( builder)
752
+ . map_block ( print_debug ( format ! ( "line {}" , line!( ) ) ) )
751
753
. fork_clone_zip ( (
752
754
|chain : Chain < f64 > | {
753
755
chain
756
+ . map_block ( print_debug ( format ! ( "line {}" , line!( ) ) ) )
754
757
. map_block ( |value|
755
758
WaitRequest {
756
759
duration : Duration :: from_secs_f64 ( value) ,
757
760
value,
758
761
}
759
762
)
763
+ . map_block ( print_debug ( format ! ( "line {}" , line!( ) ) ) )
760
764
. map_async ( wait)
765
+ . map_block ( print_debug ( format ! ( "line {}" , line!( ) ) ) )
761
766
. connect ( scope. terminate ) ;
762
767
} ,
763
768
|chain : Chain < f64 > | {
764
769
chain
770
+ . map_block ( print_debug ( format ! ( "line {}" , line!( ) ) ) )
765
771
. map_block ( |a| ( a, a) )
772
+ . map_block ( print_debug ( format ! ( "line {}" , line!( ) ) ) )
766
773
. map_block ( add)
774
+ . map_block ( print_debug ( format ! ( "line {}" , line!( ) ) ) )
767
775
. connect ( scope. terminate ) ;
768
776
}
769
777
) ) ;
@@ -782,7 +790,7 @@ mod tests {
782
790
context. run_with_conditions (
783
791
& mut promise,
784
792
FlushConditions :: new ( )
785
- . with_update_count ( 5 ) ,
793
+ . with_update_count ( 100 ) ,
786
794
) ;
787
795
788
796
dbg ! ( context. get_unhandled_errors( ) ) ;
Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ pub fn to_uppercase(value: String) -> String {
251
251
value. to_uppercase ( )
252
252
}
253
253
254
- #[ derive( Clone , Copy ) ]
254
+ #[ derive( Clone , Copy , Debug ) ]
255
255
pub struct WaitRequest < Value > {
256
256
pub duration : std:: time:: Duration ,
257
257
pub value : Value
@@ -269,7 +269,7 @@ pub async fn wait<Value>(request: WaitRequest<Value>) -> Value {
269
269
270
270
/// Use this to add a blocking map to the chain that simply prints a debug
271
271
/// message and then passes the data along.
272
- pub fn print_debug < T : std:: fmt:: Debug > ( header : String ) -> impl FnOnce ( T ) -> T {
272
+ pub fn print_debug < T : std:: fmt:: Debug > ( header : String ) -> impl Fn ( T ) -> T {
273
273
move |value| {
274
274
println ! ( "{header}: {value:?}" ) ;
275
275
value
You can’t perform that action at this time.
0 commit comments