Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. use std::fmt::Display;
  2.  
  3. fn main() {
  4. let closure = || {
  5. if true {
  6. Box::new(42usize)
  7. } else {
  8. Box::new("hi")
  9. }
  10. };
  11.  
  12. println!("Hello {}", closure);
  13. }
  14.  
  15. trait Foo: Display {}
  16. impl Foo for usize {}
  17. impl Foo for &'static str {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement