fn update_mtime(build: &Build, path: &Path) {
    let entries = match path.parent().unwrap().join("deps").read_dir() {
        Ok(entries) => entries,
        Err(_) => return,
    };
    let files = entries.map(|e| t!(e)).filter(|e| t!(e.file_type()).is_file());
    let files = files.filter(|e| {
        let filename = e.file_name();
        let filename = filename.to_str().unwrap();
        filename.ends_with(".rlib") ||
            filename.ends_with(".lib") ||
            is_dylib(&filename)
    });
    let max = files.max_by_key(|entry| {
        let meta = t!(entry.metadata());
        FileTime::from_last_modification_time(&meta)
    });
    let max = match max {
        Some(max) => max,
        None => return,
    };

    if mtime(&max.path()) > mtime(path) {
        build.verbose(&format!("updating {:?} as {:?} changed", path, max.path()));
        t!(File::create(path));
    }
}
/// Updates the mtime of a stamp file if necessary, only changing it if it's
/// older than some other library file in the same directory.
///
/// We don't know what file Cargo is going to output (because there's a hash in
/// the file name) but we know where it's going to put it. We use this helper to
/// detect changes to that output file by looking at the modification time for
/// all files in a directory and updating the stamp if any are newer.
///
/// Note that we only consider Rust libraries as that's what we're interested in
/// propagating changes from. Files like executables are tracked elsewhere.
Updates the mtime of a stamp file if necessary, only changing it if it's
older than some other library file in the same directory.

We don't know what file Cargo is going to output (because there's a hash in
the file name) but we know where it's going to put it. We use this helper to
detect changes to that output file by looking at the modification time for
all files in a directory and updating the stamp if any are newer.

Note that we only consider Rust libraries as that's what we're interested in
propagating changes from. Files like executables are tracked elsewhere.
Updates the mtime of a stamp file if necessary only changing it if it ' s older than some other library file in the same directory . We don ' t know what file Cargo is going to output ( because there ' s a hash in the file name ) but we know where it ' s going to put it . We use this helper to detect changes to that output file by looking at the modification time for all files in a directory and updating the stamp if any are newer . Note that we only consider Rust libraries as that ' s what we ' re interested in propagating changes from . Files like executables are tracked elsewhere .
fn update_mtime(build: &Build, path: &Path) {
    let entries = match path.parent().unwrap().join("deps").read_dir() {
        Ok(entries) => entries,
        Err(_) => return,
    };
    let files = entries.map(|e| t!(e)).filter(|e| t!(e.file_type()).is_file());
    let files = files.filter(|e| {
        let filename = e.file_name();
        let filename = filename.to_str().unwrap();
        filename.ends_with(".rlib") ||
            filename.ends_with(".lib") ||
            is_dylib(&filename)
    });
    let max = files.max_by_key(|entry| {
        let meta = t!(entry.metadata());
        FileTime::from_last_modification_time(&meta)
    });
    let max = match max {
        Some(max) => max,
        None => return,
    };
    if mtime(&max.path()) > mtime(path) {
        build.verbose(&format!("updating {:?} as {:?} changed", path, max.path()));
        t!(File::create(path));
    }
}
fn update_mtime ( build : & Build , path : & Path ) { let entries = match path . parent ( ) . unwrap ( ) . join ( " " ) . read_dir ( ) { Ok ( entries ) => entries , Err ( _ ) => return , } ; let files = entries . map ( | e | t ! ( e ) ) . filter ( | e | t ! ( e file_type ( ) ) . is_file ( ) ) ; let files = files . filter ( | e | { let filename = e . file_name ( ) ; let filename = filename . to_str ( ) . unwrap ( ) ; filename . ends_with ( " " ) || filename . ends_with ( " " ) || is_dylib ( & filename ) } ) ; let max = files . max_by_key ( | entry | { let meta = t ! ( entry metadata ( ) ) ; FileTime :: from_last_modification_time ( & meta ) } ) ; let max = match max { Some ( max ) => max , None => return , } ; if mtime ( & max . path ( ) ) > mtime ( path ) { build . verbose ( & format ! ( " " path max path ( ) ) ) ; t ! ( File create ( path ) ) ; } }
Updates the mtime of a stamp file if necessary, only changing it if it's
older than some other library file in the same directory.
Updates the mtime of a stamp file if necessary only changing it if it ' s older than some other library file in the same directory .
build
&Build
path
&Path
build
&Build
path
&Path