title: Is it possible to iterate over the various records from a MySQL database without using two for loops?
body: <p>This is my code:</p>
  
  <pre><code>use mysql::*;
  use mysql::prelude::*;
  
  #[derive(Debug, PartialEq, Eq)]
  struct Persone {
      id: i32,
      email: String,
  }
  
  fn main() {
      let url = "mysql://root:9211@localhost:3306/test";
      let pool = Pool::new(url).unwrap();
      let mut conn = pool.get_conn().unwrap();
  
      let select_all = conn.query_map(
          "SELECT id, email FROM persone", |(id, email)| { Persone { id, email } },
      );
  
      for row in select_all.iter() {
          for p in row {
              println!("{} - {}", p.id, p.email);
          }
      }
  }
  </code></pre>
  
  <hr>
  
  <p>I solved it this way:</p>
  
  <pre><code>for row in select_all.iter().flatten() {
      println!("{} - {}", row.id, row.email);
  }
  </code></pre>