SHARE
TWEET

Untitled

a guest Apr 25th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct Article<'a> {
  2.     content: &'a str
  3. }
  4.  
  5. fn make_article<'a>(s: &'a str) -> Article<'a> {
  6.     return Article { content: s };
  7. }
  8.  
  9. fn do_stuff() -> Article<'static> {
  10.     let s = &"hello".to_string();
  11.     let a = make_article(s);
  12.     return a;
  13. }
  14.  
  15.  
  16. fn main() {
  17.     let m = do_stuff();
  18.     println!("{}", m.content)
  19. }
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