File tree Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Original file line number Diff line number Diff line change @@ -228,3 +228,34 @@ fn issue2415() {
228
228
} ) ( )
229
229
. unwrap_or_else ( |_: Box < :: std:: error:: Error > | String :: from ( "" ) ) ;
230
230
}
231
+
232
+ impl issue_2786 {
233
+ fn thing ( & self ) {
234
+ foo ( |a| {
235
+ println ! ( "a" ) ;
236
+ println ! ( "b" ) ;
237
+ } ) . bar ( |c| {
238
+ println ! ( "a" ) ;
239
+ println ! ( "b" ) ;
240
+ } )
241
+ . baz ( |c| {
242
+ println ! ( "a" ) ;
243
+ println ! ( "b" ) ;
244
+ } )
245
+ }
246
+ }
247
+
248
+ fn issue_2773 ( ) {
249
+ let bar = Some ( 0 ) ;
250
+ bar. or_else ( || {
251
+ // do stuff
252
+ None
253
+ } ) . or_else ( || {
254
+ // do other stuff
255
+ None
256
+ } )
257
+ . and_then ( |val| {
258
+ // do this stuff
259
+ None
260
+ } ) ;
261
+ }
Original file line number Diff line number Diff line change @@ -250,3 +250,32 @@ fn issue2415() {
250
250
} ) ( ) . ok_or ( "" ) ?)
251
251
} ) ( ) . unwrap_or_else ( |_: Box < :: std:: error:: Error > | String :: from ( "" ) ) ;
252
252
}
253
+
254
+ impl issue_2786 {
255
+ fn thing ( & self ) {
256
+ foo ( |a| {
257
+ println ! ( "a" ) ;
258
+ println ! ( "b" ) ;
259
+ } ) . bar ( |c| {
260
+ println ! ( "a" ) ;
261
+ println ! ( "b" ) ;
262
+ } ) . baz ( |c| {
263
+ println ! ( "a" ) ;
264
+ println ! ( "b" ) ;
265
+ } )
266
+ }
267
+ }
268
+
269
+ fn issue_2773 ( ) {
270
+ let bar = Some ( 0 ) ;
271
+ bar. or_else ( || {
272
+ // do stuff
273
+ None
274
+ } ) . or_else ( || {
275
+ // do other stuff
276
+ None
277
+ } ) . and_then ( |val| {
278
+ // do this stuff
279
+ None
280
+ } ) ;
281
+ }
You can’t perform that action at this time.
0 commit comments