fn depot_latest<P: AsRef<Path>>(path: P) -> io::Result<Option<(DirEntry, u16)>> {
    let paths = fs::read_dir(path)?;

    let mut max = None;

    for entry in paths {
        let entry = entry?;

        if let Some(n) = entry.file_name().to_str().and_then(depot_number) {
            match max {
                Some((_, en)) if en > n => (),
                _ => max = Some((entry, n)),
            }
        }
    }

    Ok(max)
}
/// Finds the latest depot file or directory in a directory
Finds the latest depot file or directory in a directory
Finds the latest depot file or directory in a directory
fn depot_latest<P: AsRef<Path>>(path: P) -> io::Result<Option<(DirEntry, u16)>> {
    let paths = fs::read_dir(path)?;
    let mut max = None;
    for entry in paths {
        let entry = entry?;
        if let Some(n) = entry.file_name().to_str().and_then(depot_number) {
            match max {
                Some((_, en)) if en > n => (),
                _ => max = Some((entry, n)),
            }
        }
    }
    Ok(max)
}
fn depot_latest < P : AsRef < Path > > ( path : P ) -> io :: Result < Option < ( DirEntry , u16 ) > > { let paths = fs :: read_dir ( path ) ? ; let mut max = None ; for entry in paths { let entry = entry ? ; if let Some ( n ) = entry . file_name ( ) . to_str ( ) . and_then ( depot_number ) { match max { Some ( ( _ , en ) ) if en > n => ( ) , _ => max = Some ( ( entry , n ) ) , } } } Ok ( max ) }
Finds the latest depot file or directory in a directory
Finds the latest depot file or directory in a directory
path
P
path
P