fn first_that_exists(search_path: &[String],
                     filename: &str) -> Option<PathBuf> {
  for s in search_path {
    let full_path = format!("{}/{}.beam", s, filename).to_string();
    let p = Path::new(&full_path);
    if p.exists() {
      return Some(p.to_path_buf())
    }
  }
  None
}
/// Iterate through the search path list and try to find a file
Iterate through the search path list and try to find a file
Iterate through the search path list and try to find a file
fn first_that_exists(search_path: &[String],
                     filename: &str) -> Option<PathBuf> {
  for s in search_path {
    let full_path = format!("{}/{}.beam", s, filename).to_string();
    let p = Path::new(&full_path);
    if p.exists() {
      return Some(p.to_path_buf())
    }
  }
  None
}
fn first_that_exists ( search_path : & [ String ] , filename : & str ) -> Option < PathBuf > { for s in search_path { let full_path = format ! ( " " s filename ) . to_string ( ) ; let p = Path :: new ( & full_path ) ; if p . exists ( ) { return Some ( p . to_path_buf ( ) ) } } None }
Iterate through the search path list and try to find a file
Iterate through the search path list and try to find a file
search_path
&[String]
filename
&str