fn find_min_max_filenumbers(path: &Path, prefix: &str) -> (i16,i16) {

    let minmax = path
        .read_dir()
        .expect("Cannot read from data directory")
        .map   (|direntry| direntry.unwrap().path())
        .filter_map(|direntry| filename_to_fileno(prefix, &direntry).ok())
        .minmax();

    match minmax {
        NoElements    => (0,1),
        OneElement(n) => (n, n+1),
        MinMax(n,m)   => (n, m+1)
    }
}
/// Find the smallest and largest filenumbers with the given prefix
Find the smallest and largest filenumbers with the given prefix
Find the smallest and largest filenumbers with the given prefix
fn find_min_max_filenumbers(path: &Path, prefix: &str) -> (i16,i16) {
    let minmax = path
        .read_dir()
        .expect("Cannot read from data directory")
        .map   (|direntry| direntry.unwrap().path())
        .filter_map(|direntry| filename_to_fileno(prefix, &direntry).ok())
        .minmax();
    match minmax {
        NoElements    => (0,1),
        OneElement(n) => (n, n+1),
        MinMax(n,m)   => (n, m+1)
    }
}
fn find_min_max_filenumbers ( path : & Path , prefix : & str ) -> ( i16 , i16 ) { let minmax = path . read_dir ( ) . expect ( " " ) . map ( | direntry | direntry . unwrap ( ) . path ( ) ) . filter_map ( | direntry | filename_to_fileno ( prefix , & direntry ) . ok ( ) ) . minmax ( ) ; match minmax { NoElements => ( 0 , 1 ) , OneElement ( n ) => ( n , n + 1 ) , MinMax ( n , m ) => ( n , m + 1 ) } }
Find the smallest and largest filenumbers with the given prefix
Find the smallest and largest filenumbers with the given prefix
path
&Path
prefix
&str
path
&Path
prefix
&str