blob: ad593398a52bae2638f4b6f7566256edc95e3f74 [file] [log] [blame]
// Hack up our own formatting for the duration to make it easier for scripts
// to parse (always use the same number of decimal places and the same unit).
pub fn duration_to_secs_str(dur: std::time::Duration) -> String {
const NANOS_PER_SEC: f64 = 1_000_000_000.0;
let secs = dur.as_secs() as f64 +
dur.subsec_nanos() as f64 / NANOS_PER_SEC;
format!("{:.3}", secs)
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable)]
pub enum NativeLibraryKind {
/// native static library (.a archive)
NativeStatic,
/// native static library, which doesn't get bundled into .rlibs
NativeStaticNobundle,
/// macOS-specific
NativeFramework,
/// Windows dynamic library without import library.
NativeRawDylib,
/// default way to specify a dynamic library
NativeUnknown,
}
rustc_data_structures::impl_stable_hash_via_hash!(NativeLibraryKind);