2019-11-12 08:30:40 -05:00
|
|
|
// 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;
|
2019-12-22 17:42:04 -05:00
|
|
|
let secs = dur.as_secs() as f64 + dur.subsec_nanos() as f64 / NANOS_PER_SEC;
|
2019-11-12 08:30:40 -05:00
|
|
|
|
|
|
|
format!("{:.3}", secs)
|
|
|
|
}
|
2019-11-14 12:16:24 -05:00
|
|
|
|
|
|
|
#[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);
|