mirror of
https://github.com/jmcorgan/fips.git
synced 2026-10-05 19:18:25 +00:00
fix(gateway): restrict elapsed_us to Linux
The admission-limit change added elapsed_us without the target_os guard every other item in the binary carries, so fips-gateway failed to compile on macOS, Windows and FreeBSD, where std::time::Instant is not imported.
This commit is contained in:
@@ -55,6 +55,7 @@ fn main() {
|
||||
|
||||
/// Microseconds since `started`, saturating, for the timing fields on debug
|
||||
/// lines.
|
||||
#[cfg(target_os = "linux")]
|
||||
fn elapsed_us(started: Instant) -> u64 {
|
||||
u64::try_from(started.elapsed().as_micros()).unwrap_or(u64::MAX)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user