Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::fmt::Display;
- fn main() {
- let closure = || {
- if true {
- Box::new(42usize)
- } else {
- Box::new("hi")
- }
- };
- println!("Hello {}", closure);
- }
- trait Foo: Display {}
- impl Foo for usize {}
- impl Foo for &'static str {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement