Guest User

Untitled

a guest
Jul 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. trait A {
  2.  
  3. }
  4. struct A1 {
  5.  
  6. }
  7. struct A2 {
  8.  
  9. }
  10.  
  11. impl A for A1 {}
  12. impl A for A2 {}
  13.  
  14. fn test(x: i32) -> impl A {
  15. if x > 1 {
  16. A1 {}
  17. } else {
  18. A2 {}
  19. }
  20. }
Add Comment
Please, Sign In to add comment