Skip to content

Commit 58a029e

Browse files
committed
refactor!: Prepared::into_statement is now named
`Prepared::into_handle` to be more consistent with `Connection::into_handle`
1 parent a0720b4 commit 58a029e

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

odbc-api/src/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ impl<'env> ConnectionTransitions for Arc<Connection<'env>> {
10731073

10741074
fn into_prepared(self, query: &str) -> Result<Self::Prepared, Error> {
10751075
let stmt = self.prepare(query)?;
1076-
let stmt_ptr = stmt.into_statement().into_sys();
1076+
let stmt_ptr = stmt.into_handle().into_sys();
10771077
// Safe: The connection is the parent of the statement referenced by `stmt_ptr`.
10781078
let stmt = unsafe { StatementConnection::new(stmt_ptr, self) };
10791079
// `stmt` is valid and in prepared state.

odbc-api/src/prepared.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl<S> Prepared<S> {
2626
/// [`crate::handles::StatementImpl::into_sys`] or [`crate::handles::Statement::as_sys`] this
2727
/// serves as an escape hatch to access the functionality provided by `crate::sys` not yet
2828
/// accessible through safe abstractions.
29-
pub fn into_statement(self) -> S {
29+
pub fn into_handle(self) -> S {
3030
self.statement
3131
}
3232
}
@@ -117,9 +117,7 @@ where
117117
C: ColumnBuffer + HasDataType,
118118
{
119119
// We know that statement is a prepared statement.
120-
unsafe {
121-
ColumnarBulkInserter::new(self.into_statement(), parameter_buffers, index_mapping)
122-
}
120+
unsafe { ColumnarBulkInserter::new(self.into_handle(), parameter_buffers, index_mapping) }
123121
}
124122

125123
/// Use this to insert rows of string input into the database.

odbc-api/src/shared_connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<'env> ConnectionTransitions for SharedConnection<'env> {
5555
.lock()
5656
.expect("Shared connection lock must not be poisoned");
5757
let stmt = guard.prepare(query)?;
58-
let stmt_ptr = stmt.into_statement().into_sys();
58+
let stmt_ptr = stmt.into_handle().into_sys();
5959
drop(guard);
6060
// Safe: The connection is the parent of the statement referenced by `stmt_ptr`.
6161
let stmt = unsafe { StatementConnection::new(stmt_ptr, self) };

0 commit comments

Comments
 (0)