Skip to content

Commit

Permalink
Merge pull request #1109 from wprzytula/col-specs-fix-lifetime
Browse files Browse the repository at this point in the history
result: fix wrong implied lifetime in `col_specs()`
  • Loading branch information
Lorak-mmk authored Oct 28, 2024
2 parents 07553fe + 8dd1498 commit da199a1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
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

0 comments on commit da199a1

Please sign in to comment.