File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -328,19 +328,15 @@ impl RawStatement {
328328 if name_ptr. is_null ( ) {
329329 return Err ( Error :: DuckDBFailure (
330330 ffi:: Error :: new ( ffi:: DuckDBError ) ,
331- Some ( format ! ( "Could not retrieve parameter name for index {}" , idx ) ) ,
331+ Some ( format ! ( "Could not retrieve parameter name for index {idx}" ) ) ,
332332 ) ) ;
333333 }
334334
335- let c_str = CStr :: from_ptr ( name_ptr) ;
336- let result = c_str
337- . to_str ( )
338- . map ( |s| s. to_string ( ) )
339- . map_err ( |e| Error :: FromSqlConversionFailure ( 0 , crate :: types:: Type :: Text , Box :: new ( e) ) ) ;
335+ let name = CStr :: from_ptr ( name_ptr) . to_string_lossy ( ) . to_string ( ) ;
340336
341337 ffi:: duckdb_free ( name_ptr as * mut std:: ffi:: c_void ) ;
342338
343- result
339+ Ok ( name )
344340 }
345341 }
346342
You can’t perform that action at this time.
0 commit comments