Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait Foo {}
- impl Foo for u32 {}
- impl Foo for Vec<u32> {}
- fn do_foo(n: i32) -> impl Foo {
- if n > 10 {
- 4u32
- } else {
- vec![4u32]
- }
- }
- fn main() {
- let a = do_foo(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement