Skip to content

Commit da199a1

Browse files
authored
Merge pull request #1109 from wprzytula/col-specs-fix-lifetime
result: fix wrong implied lifetime in `col_specs()`
2 parents 07553fe + 8dd1498 commit da199a1

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

scylla-cql/src/frame/response/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ impl<'a> ResultMetadata<'a> {
549549
}
550550

551551
#[inline]
552-
pub fn col_specs(&self) -> &[ColumnSpec] {
552+
pub fn col_specs(&self) -> &[ColumnSpec<'a>] {
553553
&self.col_specs
554554
}
555555
}

scylla/src/statement/prepared_statement.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ impl PreparedStatement {
407407
}
408408

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

@@ -422,7 +422,7 @@ impl PreparedStatement {
422422
}
423423

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

scylla/src/transport/iterator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ impl RowIterator {
396396
}
397397

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

@@ -904,7 +904,7 @@ impl<RowT> TypedRowIterator<RowT> {
904904
}
905905

906906
/// Returns specification of row columns
907-
pub fn get_column_specs(&self) -> &[ColumnSpec] {
907+
pub fn get_column_specs(&self) -> &[ColumnSpec<'static>] {
908908
self.row_iterator.get_column_specs()
909909
}
910910
}

scylla/src/transport/query_result.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl QueryResult {
138138

139139
/// Returns column specifications.
140140
#[inline]
141-
pub fn col_specs(&self) -> &[ColumnSpec] {
141+
pub fn col_specs(&self) -> &[ColumnSpec<'static>] {
142142
self.metadata
143143
.as_ref()
144144
.map(|metadata| metadata.col_specs())
@@ -147,7 +147,7 @@ impl QueryResult {
147147

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

0 commit comments

Comments
 (0)