SHARE
TWEET

Untitled

a guest Feb 20th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::any::Any;
  2. use std::fmt::Debug;
  3.  
  4. fn funny<T>(t: T) where T: Any + Sized + Debug {
  5.     println!("{:?}", t);
  6. }
  7.  
  8. fn main() {
  9.     let value = true;
  10.     let suck_fn = suck(value);
  11.     funny(true)
  12.    
  13. }
  14.  
  15. fn suck<T: Any + Sized>(t:T) -> (Box<FnOnce(bool) -> T>) {
  16.     Box::new(move|_| { t })
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top