Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

result: fix wrong implied lifetime in col_specs() #1109

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scylla-cql/src/frame/response/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ impl<'a> ResultMetadata<'a> {
}

#[inline]
pub fn col_specs(&self) -> &[ColumnSpec] {
pub fn col_specs(&self) -> &[ColumnSpec<'a>] {
&self.col_specs
}
}
Expand Down
4 changes: 2 additions & 2 deletions scylla/src/statement/prepared_statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ impl PreparedStatement {
}

/// Access column specifications of the bind variables of this statement
pub fn get_variable_col_specs(&self) -> &[ColumnSpec] {
pub fn get_variable_col_specs(&self) -> &[ColumnSpec<'static>] {
&self.shared.metadata.col_specs
}

Expand All @@ -422,7 +422,7 @@ impl PreparedStatement {
}

/// Access column specifications of the result set returned after the execution of this statement
pub fn get_result_set_col_specs(&self) -> &[ColumnSpec] {
pub fn get_result_set_col_specs(&self) -> &[ColumnSpec<'static>] {
self.shared.result_metadata.col_specs()
}

Expand Down
4 changes: 2 additions & 2 deletions scylla/src/transport/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ impl RowIterator {
}

/// Returns specification of row columns
pub fn get_column_specs(&self) -> &[ColumnSpec] {
pub fn get_column_specs(&self) -> &[ColumnSpec<'static>] {
self.current_page.metadata.col_specs()
}

Expand Down Expand Up @@ -904,7 +904,7 @@ impl<RowT> TypedRowIterator<RowT> {
}

/// Returns specification of row columns
pub fn get_column_specs(&self) -> &[ColumnSpec] {
pub fn get_column_specs(&self) -> &[ColumnSpec<'static>] {
self.row_iterator.get_column_specs()
}
}
Expand Down
4 changes: 2 additions & 2 deletions scylla/src/transport/query_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl QueryResult {

/// Returns column specifications.
#[inline]
pub fn col_specs(&self) -> &[ColumnSpec] {
pub fn col_specs(&self) -> &[ColumnSpec<'static>] {
self.metadata
.as_ref()
.map(|metadata| metadata.col_specs())
Expand All @@ -147,7 +147,7 @@ impl QueryResult {

/// Returns a column specification for a column with given name, or None if not found
#[inline]
pub fn get_column_spec<'a>(&'a self, name: &str) -> Option<(usize, &'a ColumnSpec)> {
pub fn get_column_spec<'a>(&'a self, name: &str) -> Option<(usize, &'a ColumnSpec<'static>)> {
self.col_specs()
.iter()
.enumerate()
Expand Down
Loading