Guest User

Untitled

a guest
Jan 21st, 2018
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.33 KB | None | 0 0
  1. // FIXME: Make me compile! Diff budget: 1 line.
  2.  
  3. struct StrWrapper<'a>(&'a str);
  4.  
  5. impl<'a> StrWrapper<'a> {
  6.     fn inner(&self) -> &str {
  7.         self.0
  8.     }
  9. }
  10.  
  11. // Do not modify this function.
  12. pub fn main() {
  13.     let string = "Hello!";
  14.     let wrapper = StrWrapper(&string);
  15.     let _: &'static str = wrapper.inner();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment