From f3783d1b54a388d4c8470ee98131f73aaa1ed034 Mon Sep 17 00:00:00 2001 From: Steve Lau Date: Fri, 11 Oct 2024 15:04:13 +0800 Subject: [PATCH 1/2] refactor: more CStr literals --- pgrx-tests/src/tests/roundtrip_tests.rs | 6 +++--- pgrx-tests/tests/todo/roundtrip-tests.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pgrx-tests/src/tests/roundtrip_tests.rs b/pgrx-tests/src/tests/roundtrip_tests.rs index 757078734a..951dd3e42e 100644 --- a/pgrx-tests/src/tests/roundtrip_tests.rs +++ b/pgrx-tests/src/tests/roundtrip_tests.rs @@ -214,10 +214,10 @@ mod tests { // Vec>, // vec![ // None, - // Some(unsafe { CStr::from_bytes_with_nul_unchecked(b"&one\0") }), - // Some(unsafe { CStr::from_bytes_with_nul_unchecked(b"&two\0") }), + // Some(unsafe { c"&one" }), + // Some(unsafe { c"&two" }), // None, - // Some(unsafe { CStr::from_bytes_with_nul_unchecked(b"&three\0") }), + // Some(unsafe { c"&three" }), // None, // ] // ); diff --git a/pgrx-tests/tests/todo/roundtrip-tests.rs b/pgrx-tests/tests/todo/roundtrip-tests.rs index 0379ba5fda..11f020e31c 100644 --- a/pgrx-tests/tests/todo/roundtrip-tests.rs +++ b/pgrx-tests/tests/todo/roundtrip-tests.rs @@ -76,10 +76,10 @@ mod tests { Vec>, vec![ None, - Some(unsafe { CStr::from_bytes_with_nul_unchecked(b"&one\0") }), - Some(unsafe { CStr::from_bytes_with_nul_unchecked(b"&two\0") }), + Some(unsafe { c"&one" }), + Some(unsafe { c"&two" }), None, - Some(unsafe { CStr::from_bytes_with_nul_unchecked(b"&three\0") }), + Some(unsafe { "&three" }), None, ] ); From f54c6d96d2cd4f5169c1050c6a7705c0e161c903 Mon Sep 17 00:00:00 2001 From: Steve Lau Date: Fri, 11 Oct 2024 15:27:01 +0800 Subject: [PATCH 2/2] test: fix it --- pgrx-tests/src/tests/roundtrip_tests.rs | 6 +++--- pgrx-tests/tests/todo/roundtrip-tests.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pgrx-tests/src/tests/roundtrip_tests.rs b/pgrx-tests/src/tests/roundtrip_tests.rs index 951dd3e42e..9ca159e24e 100644 --- a/pgrx-tests/src/tests/roundtrip_tests.rs +++ b/pgrx-tests/src/tests/roundtrip_tests.rs @@ -214,10 +214,10 @@ mod tests { // Vec>, // vec![ // None, - // Some(unsafe { c"&one" }), - // Some(unsafe { c"&two" }), + // Some( c"&one" ), + // Some( c"&two" ), // None, - // Some(unsafe { c"&three" }), + // Some( c"&three" ), // None, // ] // ); diff --git a/pgrx-tests/tests/todo/roundtrip-tests.rs b/pgrx-tests/tests/todo/roundtrip-tests.rs index 11f020e31c..ce84039c29 100644 --- a/pgrx-tests/tests/todo/roundtrip-tests.rs +++ b/pgrx-tests/tests/todo/roundtrip-tests.rs @@ -76,10 +76,10 @@ mod tests { Vec>, vec![ None, - Some(unsafe { c"&one" }), - Some(unsafe { c"&two" }), + Some( c"&one" ), + Some( c"&two" ), None, - Some(unsafe { "&three" }), + Some( c"&three" ), None, ] );