diff --git a/.cargo/config.toml b/.cargo/config.toml index 039e3cbe0..25bcb1902 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -3,3 +3,8 @@ # in order to produce a valid binary (mainly because of curl crate) [target.'cfg(target_env = "musl")'] rustflags = ["-Ctarget-feature=-crt-static"] + +# Desactivate static linking for `cargo test --doc` +# Should be only activated for Alpine but I don't know how to set it... +[build] +rustdocflags = ["-Ctarget-feature=-crt-static"] diff --git a/packages/hurl/src/http/client.rs b/packages/hurl/src/http/client.rs index 7f0e69c56..a0a7aa385 100644 --- a/packages/hurl/src/http/client.rs +++ b/packages/hurl/src/http/client.rs @@ -347,13 +347,13 @@ impl Client { }; if verbose { + // FIXME: the cast to u64 seems not necessary. + // If we dont cast from u128 and try to format! or println! + // we have a segfault on Alpine Docker images and Rust 1.68.0, whereas it was + // ok with Rust >= 1.67.0. + let duration = duration.as_millis() as u64; logger.debug_important( - format!( - "Response: (received {} bytes in {} ms)", - length, - duration.as_millis() - ) - .as_str(), + format!("Response: (received {length} bytes in {duration} ms)").as_str(), ); logger.debug("");