@@ -85,7 +85,7 @@ impl InnerConnection {
8585 }
8686
8787 pub fn execute ( & mut self , sql : & str ) -> Result < ( ) > {
88- let c_str = CString :: new ( sql) . unwrap ( ) ;
88+ let c_str = CString :: new ( sql) ? ;
8989 unsafe {
9090 let mut out = mem:: zeroed ( ) ;
9191 let r = ffi:: duckdb_query_arrow ( self . con , c_str. as_ptr ( ) as * const c_char , & mut out) ;
@@ -96,7 +96,7 @@ impl InnerConnection {
9696 }
9797
9898 pub fn prepare < ' a > ( & mut self , conn : & ' a Connection , sql : & str ) -> Result < Statement < ' a > > {
99- let c_str = CString :: new ( sql) . unwrap ( ) ;
99+ let c_str = CString :: new ( sql) ? ;
100100
101101 // Extract statements (handles both single and multi-statement queries)
102102 let mut extracted = ptr:: null_mut ( ) ;
@@ -162,8 +162,8 @@ impl InnerConnection {
162162
163163 pub fn appender < ' a > ( & mut self , conn : & ' a Connection , table : & str , schema : & str ) -> Result < Appender < ' a > > {
164164 let mut c_app: ffi:: duckdb_appender = ptr:: null_mut ( ) ;
165- let c_table = CString :: new ( table) . unwrap ( ) ;
166- let c_schema = CString :: new ( schema) . unwrap ( ) ;
165+ let c_table = CString :: new ( table) ? ;
166+ let c_schema = CString :: new ( schema) ? ;
167167 let r = unsafe {
168168 ffi:: duckdb_appender_create (
169169 self . con ,
@@ -184,9 +184,9 @@ impl InnerConnection {
184184 schema : & str ,
185185 ) -> Result < Appender < ' a > > {
186186 let mut c_app: ffi:: duckdb_appender = ptr:: null_mut ( ) ;
187- let c_table = CString :: new ( table) . unwrap ( ) ;
188- let c_catalog = CString :: new ( catalog) . unwrap ( ) ;
189- let c_schema = CString :: new ( schema) . unwrap ( ) ;
187+ let c_table = CString :: new ( table) ? ;
188+ let c_catalog = CString :: new ( catalog) ? ;
189+ let c_schema = CString :: new ( schema) ? ;
190190
191191 let r = unsafe {
192192 ffi:: duckdb_appender_create_ext (
0 commit comments