mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-03 01:16:14 +03:00
Use Metadata::modified instead of FileTime::from_last_modification_time in run_cargo
Metadata::modified works in all platforms supported by the filetime crate. This changes brings rustbuild a tiny bit closer towards dropping the filetime dependency.
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
use std::str;
|
||||
|
||||
use build_helper::{output, t, up_to_date};
|
||||
use filetime::FileTime;
|
||||
use serde::Deserialize;
|
||||
|
||||
use crate::builder::Cargo;
|
||||
@@ -1334,8 +1333,9 @@ pub fn run_cargo(
|
||||
.map(|s| s.starts_with('-') && s.ends_with(&extension[..]))
|
||||
.unwrap_or(false)
|
||||
});
|
||||
let max = candidates
|
||||
.max_by_key(|&&(_, _, ref metadata)| FileTime::from_last_modification_time(metadata));
|
||||
let max = candidates.max_by_key(|&&(_, _, ref metadata)| {
|
||||
metadata.modified().expect("mtime should be available on all relevant OSes")
|
||||
});
|
||||
let path_to_add = match max {
|
||||
Some(triple) => triple.0.to_str().unwrap(),
|
||||
None => panic!("no output generated for {:?} {:?}", prefix, extension),
|
||||
|
||||
Reference in New Issue
Block a user