title: how to pass every line from a text file as an argument in rust
body: <p>i have made this code to check for alive urls in a text file it was first to check for a single url the script worked but then i wanted  to make it multithreaded i got this error</p>
  <p><a href="https://i.stack.imgur.com/LSCQu.png" rel="nofollow noreferrer">error</a></p>
  <p>here is the original code :</p>
  <pre><code>use hyper_tls::HttpsConnector;
  use hyper::Client;
  use tokio::io::BufReader;
  
  
  
  #[tokio::main]
  async fn main() -&gt; Result&lt;(), Box&lt;dyn std::error::Error + Send + Sync&gt;&gt; {
  
      let https = HttpsConnector::new();
      let url = std::env::args().nth(1).expect(&quot;no list given&quot;);
      let client = Client::builder().build::&lt;_, hyper::Body&gt;(https);
  
      let reader = BufReader::new(url);
      let lines = reader.lines(); 
        
  
  for l in lines {    
  
      let sep = l.parse()?;
  
     // Await the response...
      let resp = client.get(sep).await?;
  
  if resp.status() == 200 {
     println!(&quot;{}&quot;, l);}
  
  if resp.status() == 301 {
     println!(&quot;{}&quot;, l); }
  
     }
  
  
       Ok(())    
  }
  </code></pre>