Loading openssl-errors/src/lib.rs +2 −1 Original line number Diff line number Diff line Loading @@ -217,8 +217,9 @@ macro_rules! put_error { $reason, concat!(file!(), "\0"), line!(), // go through format_args to ensure the message string is handled in the same way as the args case $crate::export::Option::Some($crate::export::Cow::Borrowed( concat!($message, "\0"), format_args!(concat!($message, "\0")).as_str().unwrap(), )), ); } Loading openssl-errors/tests/test.rs +5 −5 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ fn basic() { error.file().replace(r"\", "/"), "openssl-errors/tests/test.rs" ); assert_eq!(error.line(), 20); assert_eq!(error.line(), line!() - 11); cfg_if! { if #[cfg(ossl300)] { // https://github.com/openssl/openssl/issues/12530 Loading @@ -41,7 +41,7 @@ fn basic() { #[test] fn static_data() { openssl_errors::put_error!(Test::BAR, Test::NO_BACON, "foobar"); openssl_errors::put_error!(Test::BAR, Test::NO_BACON, "foobar {{}}"); let error = Error::get().unwrap(); assert_eq!(error.library().unwrap(), "test library"); Loading @@ -52,8 +52,8 @@ fn static_data() { error.file().replace(r"\", "/"), "openssl-errors/tests/test.rs" ); assert_eq!(error.line(), 44); assert_eq!(error.data(), Some("foobar")); assert_eq!(error.line(), line!() - 11); assert_eq!(error.data(), Some("foobar {}")); } #[test] Loading @@ -69,6 +69,6 @@ fn dynamic_data() { error.file().replace(r"\", "/"), "openssl-errors/tests/test.rs" ); assert_eq!(error.line(), 61); assert_eq!(error.line(), line!() - 11); assert_eq!(error.data(), Some("hello world")); } Loading
openssl-errors/src/lib.rs +2 −1 Original line number Diff line number Diff line Loading @@ -217,8 +217,9 @@ macro_rules! put_error { $reason, concat!(file!(), "\0"), line!(), // go through format_args to ensure the message string is handled in the same way as the args case $crate::export::Option::Some($crate::export::Cow::Borrowed( concat!($message, "\0"), format_args!(concat!($message, "\0")).as_str().unwrap(), )), ); } Loading
openssl-errors/tests/test.rs +5 −5 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ fn basic() { error.file().replace(r"\", "/"), "openssl-errors/tests/test.rs" ); assert_eq!(error.line(), 20); assert_eq!(error.line(), line!() - 11); cfg_if! { if #[cfg(ossl300)] { // https://github.com/openssl/openssl/issues/12530 Loading @@ -41,7 +41,7 @@ fn basic() { #[test] fn static_data() { openssl_errors::put_error!(Test::BAR, Test::NO_BACON, "foobar"); openssl_errors::put_error!(Test::BAR, Test::NO_BACON, "foobar {{}}"); let error = Error::get().unwrap(); assert_eq!(error.library().unwrap(), "test library"); Loading @@ -52,8 +52,8 @@ fn static_data() { error.file().replace(r"\", "/"), "openssl-errors/tests/test.rs" ); assert_eq!(error.line(), 44); assert_eq!(error.data(), Some("foobar")); assert_eq!(error.line(), line!() - 11); assert_eq!(error.data(), Some("foobar {}")); } #[test] Loading @@ -69,6 +69,6 @@ fn dynamic_data() { error.file().replace(r"\", "/"), "openssl-errors/tests/test.rs" ); assert_eq!(error.line(), 61); assert_eq!(error.line(), line!() - 11); assert_eq!(error.data(), Some("hello world")); }