Skip to content

Commit 55f5500

Browse files
authored
Merge pull request #343 from wprzytula/consistency-it
Introduce an IT for consistency
2 parents 85d4eb8 + 289727b commit 55f5500

File tree

6 files changed

+908
-10
lines changed

6 files changed

+908
-10
lines changed

scylla-rust-wrapper/Cargo.lock

Lines changed: 13 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scylla-rust-wrapper/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ chrono = "0.4.20"
3535

3636
[dev-dependencies]
3737
scylla-proxy = { git = "https://github.com/scylladb/scylla-rust-driver.git", rev = "v1.3.0" }
38+
scylla-cql = { git = "https://github.com/scylladb/scylla-rust-driver.git", rev = "v1.3.0" }
3839
bytes = "1.10.0"
39-
40+
itertools = "0.10.3"
4041
assert_matches = "1.5.0"
4142
ntest = "0.9.3"
4243
rusty-fork = "0.3.0"
44+
4345
[lib]
4446
name = "scylla_cpp_driver"
4547
crate-type = ["cdylib", "staticlib", "lib"]

scylla-rust-wrapper/src/argconv.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ use std::os::raw::c_char;
66
use std::ptr::NonNull;
77
use std::sync::{Arc, Weak};
88

9-
pub(crate) unsafe fn ptr_to_cstr(ptr: *const c_char) -> Option<&'static str> {
9+
pub unsafe fn ptr_to_cstr(ptr: *const c_char) -> Option<&'static str> {
1010
unsafe { CStr::from_ptr(ptr) }.to_str().ok()
1111
}
1212

13-
pub(crate) unsafe fn ptr_to_cstr_n(ptr: *const c_char, size: size_t) -> Option<&'static str> {
13+
pub unsafe fn ptr_to_cstr_n(ptr: *const c_char, size: size_t) -> Option<&'static str> {
1414
if ptr.is_null() {
1515
return None;
1616
}
@@ -228,9 +228,8 @@ pub type CassBorrowedExclusivePtr<'a, T, CM> = CassPtr<'a, T, (Exclusive, CM)>;
228228

229229
/// Utility method for tests. Useful when some method returns `T*`,
230230
/// and then another method accepts `const T*`.
231-
#[cfg(test)]
232231
impl<'a, T: Sized, P: Properties> CassPtr<'a, T, P> {
233-
pub(crate) fn into_c_const(self) -> CassPtr<'a, T, (P::Onwership, CConst)> {
232+
pub fn into_c_const(self) -> CassPtr<'a, T, (P::Onwership, CConst)> {
234233
CassPtr {
235234
ptr: self.ptr,
236235
_phantom: PhantomData,
@@ -309,7 +308,7 @@ impl<T: Sized, P: Properties> CassPtr<'_, T, P> {
309308
/// Resulting pointer inherits the lifetime from the immutable borrow
310309
/// of original pointer.
311310
#[allow(clippy::needless_lifetimes)]
312-
pub(crate) fn borrow<'a>(&'a self) -> CassPtr<'a, T, (Shared, P::CMutability)> {
311+
pub fn borrow<'a>(&'a self) -> CassPtr<'a, T, (Shared, P::CMutability)> {
313312
CassPtr {
314313
ptr: self.ptr,
315314
_phantom: PhantomData,
@@ -323,8 +322,7 @@ impl<T: Sized> CassPtr<'_, T, (Exclusive, CMut)> {
323322
/// of original pointer. Since the method accepts a mutable reference
324323
/// to the original pointer, we enforce aliasing ^ mutability principle at compile time.
325324
#[allow(clippy::needless_lifetimes)]
326-
#[cfg_attr(not(test), expect(unused))]
327-
pub(crate) fn borrow_mut<'a>(&'a mut self) -> CassPtr<'a, T, (Exclusive, CMut)> {
325+
pub fn borrow_mut<'a>(&'a mut self) -> CassPtr<'a, T, (Exclusive, CMut)> {
328326
CassPtr {
329327
ptr: self.ptr,
330328
_phantom: PhantomData,

0 commit comments

Comments
 (0)