Guest User

Untitled

a guest
Jun 18th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. use std::io::{self, BufRead};
  2.  
  3. fn main() {
  4. let stdin = io::stdin();
  5.  
  6. let mut content_length = 0;
  7. let mut warc_url = "";
  8. for line_wrapped in stdin.lock().lines() {
  9. let line = line_wrapped.unwrap();
  10. if line.starts_with("Content-Length: ") {
  11. content_length = line.split("Content-Length: ").nth(1).unwrap().parse().unwrap();
  12. } else if line.starts_with("WARC-Target-URI: ") {
  13. warc_url = line.split("WARC-Target-URI: ").nth(1).unwrap().clone();
  14. }
  15. }
  16. }
Add Comment
Please, Sign In to add comment