Advertisement
Guest User

Untitled

a guest
May 20th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. fn main() {
  2. for line in io::stdin().lock().lines() {
  3. let line2 = line.unwrap();
  4. let line3 = line2.as_bytes();
  5. let value = json().parse(line3); // pub fn parse(&self, input: &'a [I]) -> Result<O>
  6. let value2 = value.unwrap();
  7. }
  8. }
  9.  
  10. /*
  11. error[E0597]: `line2` does not live long enough
  12. --> src/main.rs:71:21
  13. |
  14. 71 | let line3 = line2.as_bytes();
  15. | ^^^^^-----------
  16. | |
  17. | borrowed value does not live long enough
  18. | argument requires that `line2` is borrowed for `'static`
  19. ...
  20. 74 | }
  21. | - `line2` dropped here while still borrowed
  22.  
  23. error: aborting due to previous error
  24. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement