@@ -310,3 +310,82 @@ fn guards() {
310310 cccccccccccccccccccccccccccccccccccccccc) => { }
311311 }
312312}
313+
314+ fn issue1371 ( ) {
315+ Some ( match type_ {
316+ sfEvtClosed => Closed ,
317+ sfEvtResized => {
318+ let e = unsafe { * event. size . as_ref ( ) } ;
319+
320+ Resized {
321+ width : e. width ,
322+ height : e. height ,
323+ }
324+ }
325+ sfEvtLostFocus => LostFocus ,
326+ sfEvtGainedFocus => GainedFocus ,
327+ sfEvtTextEntered => {
328+ TextEntered {
329+ unicode :
330+ unsafe {
331+ :: std:: char:: from_u32 ( ( * event. text . as_ref ( ) ) . unicode )
332+ . expect ( "Invalid unicode encountered on TextEntered event" )
333+ } ,
334+ }
335+ }
336+ sfEvtKeyPressed => {
337+ let e = unsafe { event. key . as_ref ( ) } ;
338+
339+ KeyPressed {
340+ code : unsafe { :: std:: mem:: transmute ( e. code ) } ,
341+ alt : e. alt . to_bool ( ) ,
342+ ctrl : e. control . to_bool ( ) ,
343+ shift : e. shift . to_bool ( ) ,
344+ system : e. system . to_bool ( ) ,
345+ }
346+ }
347+ sfEvtKeyReleased => {
348+ let e = unsafe { event. key . as_ref ( ) } ;
349+
350+ KeyReleased {
351+ code : unsafe { :: std:: mem:: transmute ( e. code ) } ,
352+ alt : e. alt . to_bool ( ) ,
353+ ctrl : e. control . to_bool ( ) ,
354+ shift : e. shift . to_bool ( ) ,
355+ system : e. system . to_bool ( ) ,
356+ }
357+ }
358+ } )
359+ }
360+
361+ fn issue1395 ( ) {
362+ let bar = Some ( true ) ;
363+ let foo = Some ( true ) ;
364+ let mut x = false ;
365+ bar. and_then ( |_| match foo {
366+ None => None ,
367+ Some ( b) => {
368+ x = true ;
369+ Some ( b)
370+ }
371+ } ) ;
372+ }
373+
374+ fn issue1456 ( ) {
375+ Ok ( Recording {
376+ artists : match reader
377+ . evaluate ( ".//mb:recording/mb:artist-credit/mb:name-credit" ) ? {
378+ Nodeset ( nodeset) => {
379+ let res: Result < Vec < ArtistRef > , ReadError > = nodeset
380+ . iter ( )
381+ . map ( |node| {
382+ XPathNodeReader :: new ( node, & context)
383+ . and_then ( |r| ArtistRef :: from_xml ( & r) )
384+ } )
385+ . collect ( ) ;
386+ res?
387+ }
388+ _ => Vec :: new ( ) ,
389+ } ,
390+ } )
391+ }
0 commit comments