Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. trait Foo {}
  2.  
  3. impl Foo for u32 {}
  4. impl Foo for Vec<u32> {}
  5.  
  6. fn do_foo(n: i32) -> impl Foo {
  7. if n > 10 {
  8. 4u32
  9. } else {
  10. vec![4u32]
  11. }
  12. }
  13.  
  14. fn main() {
  15. let a = do_foo(1);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement