There was an error while loading. Please reload this page.
1 parent 09ad0ef commit 41abebeCopy full SHA for 41abebe
1 file changed
src/query.rs
@@ -95,7 +95,7 @@ pub fn deparse(protobuf: &protobuf::ParseResult) -> Result<String> {
95
/// assert_eq!(result, "SELECT * FROM contacts WHERE name=$1");
96
/// ```
97
pub fn normalize(statement: &str) -> Result<String> {
98
- let input = CString::new(statement).unwrap();
+ let input = CString::new(statement)?;
99
let result = unsafe { pg_query_normalize(input.as_ptr()) };
100
let normalized_query = if !result.error.is_null() {
101
let message = unsafe { CStr::from_ptr((*result.error).message) }.to_string_lossy().to_string();
0 commit comments