Skip to content

Commit

Permalink
Merge pull request #1133 from muzarski/cpp-rust-decouple-query-rows-r…
Browse files Browse the repository at this point in the history
…esult

rows_result: implement into_inner behind `cpp_rust_unstable` cfg
  • Loading branch information
Lorak-mmk authored Dec 2, 2024
2 parents 49c342e + ead6ef0 commit 62f96b3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
run: cargo clippy --verbose --all-targets
- name: Clippy check with all features
run: cargo clippy --verbose --all-targets --all-features
- name: Cargo check with cpp_rust_unstable cfg
run: RUSTFLAGS="--cfg cpp_rust_unstable" cargo clippy --verbose --all-targets --all-features
- name: Cargo check without features
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features ""
- name: Cargo check with all serialization features
Expand Down
6 changes: 5 additions & 1 deletion scylla/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,8 @@ harness = false
[lints.rust]
unnameable_types = "warn"
unreachable_pub = "warn"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(scylla_cloud_tests)', 'cfg(cassandra_tests)'] }
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(scylla_cloud_tests)',
'cfg(cassandra_tests)',
'cfg(cpp_rust_unstable)',
] }
3 changes: 3 additions & 0 deletions scylla/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ pub mod frame {
pub(crate) use scylla_cql::frame::response::*;

pub mod result {
#[cfg(cpp_rust_unstable)]
pub use scylla_cql::frame::response::result::DeserializedMetadataAndRawRows;

pub(crate) use scylla_cql::frame::response::result::*;
pub use scylla_cql::frame::response::result::{
ColumnSpec, ColumnType, CqlValue, PartitionKeyIndex, Row, TableSpec,
Expand Down
11 changes: 11 additions & 0 deletions scylla/src/transport/query_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,17 @@ impl QueryRowsResult {
Err(RowsError::TypeCheckFailed(err)) => Err(SingleRowError::TypeCheckFailed(err)),
}
}

#[cfg(cpp_rust_unstable)]
pub fn into_inner(self) -> (DeserializedMetadataAndRawRows, Option<Uuid>, Vec<String>) {
let Self {
raw_rows_with_metadata,
tracing_id,
warnings,
} = self;

(raw_rows_with_metadata, tracing_id, warnings)
}
}

/// An error returned by [`QueryResult::into_rows_result`]
Expand Down

0 comments on commit 62f96b3

Please sign in to comment.