Skip to content

Commit 2764fc1

Browse files
authored
Merge pull request #1260 from Lorak-mmk/review-doc-hidden
Address unnecessary doc(hidden)
2 parents d65e7cf + 8e6ff71 commit 2764fc1

File tree

27 files changed

+537
-534
lines changed

27 files changed

+537
-534
lines changed

Cargo.lock.msrv

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

docs/source/data-types/udt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ and `DeserializeValue` macros documentation.
2020
```rust
2121
# extern crate scylla;
2222
# async fn check_only_compiles() {
23-
use scylla::macros::{DeserializeValue, SerializeValue};
23+
use scylla::{DeserializeValue, SerializeValue};
2424

2525
// Define a custom struct that matches the User Defined Type created earlier.
2626
// Fields don't have to be in the same order as they are in the database.
@@ -48,7 +48,7 @@ Now it can be sent and received just like any other CQL value:
4848
# use std::error::Error;
4949
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
5050
use futures::TryStreamExt;
51-
use scylla::macros::{DeserializeValue, SerializeValue};
51+
use scylla::{DeserializeValue, SerializeValue};
5252

5353
#[derive(Debug, DeserializeValue, SerializeValue)]
5454
struct MyType {

docs/source/statements/result.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ Field names don't need to match column names.
9797
# use scylla::client::session::Session;
9898
# use std::error::Error;
9999
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
100-
use scylla::macros::DeserializeRow;
101-
use scylla::deserialize::DeserializeRow;
100+
use scylla::DeserializeRow;
101+
use scylla::deserialize::row::DeserializeRow;
102102

103103
#[derive(DeserializeRow)]
104104
struct MyRow {
@@ -120,4 +120,4 @@ for row in result_rows.rows::<MyRow>()? {
120120
```
121121

122122
### Other data types
123-
For parsing other data types see [Data Types](../data-types/data-types.md)
123+
For parsing other data types see [Data Types](../data-types/data-types.md)

examples/custom_deserialization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use anyhow::Result;
22
use scylla::client::session::Session;
33
use scylla::client::session_builder::SessionBuilder;
4-
use scylla::deserialize::DeserializeValue;
4+
use scylla::deserialize::value::DeserializeValue;
55
use scylla::frame::response::result::ColumnType;
66
use std::env;
77

examples/user-defined-type.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use anyhow::Result;
22
use futures::TryStreamExt as _;
33
use scylla::client::session::Session;
44
use scylla::client::session_builder::SessionBuilder;
5-
use scylla::macros::DeserializeValue;
6-
use scylla::SerializeValue;
5+
use scylla::{DeserializeValue, SerializeValue};
76
use std::env;
87

98
#[tokio::main]

scylla-cql/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ categories = ["database"]
1111
license = "MIT OR Apache-2.0"
1212

1313
[dependencies]
14-
scylla-macros = { version = "0.7.0", path = "../scylla-macros" }
14+
scylla-macros = { version = "=0.7.0", path = "../scylla-macros" }
1515
byteorder = "1.3.4"
1616
bytes = "1.0.1"
1717
tokio = { version = "1.34", features = ["io-util", "time"] }

scylla-cql/src/deserialize/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,6 @@ pub mod value;
217217

218218
pub use frame_slice::FrameSlice;
219219

220-
pub use row::DeserializeRow;
221-
pub use value::DeserializeValue;
222-
223220
use std::error::Error;
224221
use std::sync::Arc;
225222

@@ -238,8 +235,9 @@ use thiserror::Error;
238235
/// one of types with an impl built into the driver fails. It is also returned
239236
/// from impls generated by the `DeserializeRow` macro.
240237
/// - [`value::BuiltinTypeCheckError`] is analogous to the above but is
241-
/// returned from [`DeserializeValue::type_check`] instead both in the case of
242-
/// builtin impls and impls generated by the `DeserializeValue` macro.
238+
/// returned from [`DeserializeValue::type_check`](value::DeserializeValue::type_check)
239+
/// instead both in the case of builtin impls and impls generated by the
240+
/// `DeserializeValue` macro.
243241
/// It won't be returned by the `Session` directly, but it might be nested
244242
/// in the [`row::BuiltinTypeCheckError`].
245243
#[derive(Debug, Clone, Error)]
@@ -269,8 +267,9 @@ impl TypeCheckError {
269267
/// one of types with an impl built into the driver fails. It is also returned
270268
/// from impls generated by the `DeserializeRow` macro.
271269
/// - [`value::BuiltinDeserializationError`] is analogous to the above but is
272-
/// returned from [`DeserializeValue::deserialize`] instead both in the case of
273-
/// builtin impls and impls generated by the `DeserializeValue` macro.
270+
/// returned from [`DeserializeValue::deserialize`](value::DeserializeValue::deserialize)
271+
/// instead both in the case of builtin impls and impls generated by the
272+
/// `DeserializeValue` macro.
274273
/// It won't be returned by the `Session` directly, but it might be nested
275274
/// in the [`row::BuiltinDeserializationError`].
276275
#[derive(Debug, Clone, Error)]
@@ -296,10 +295,11 @@ impl DeserializationError {
296295
// - ONLY in proper type_check()/deserialize() implementation,
297296
// - BEFORE an error is cloned (because otherwise the Arc::get_mut fails).
298297
macro_rules! make_error_replace_rust_name {
299-
($fn_name: ident, $outer_err: ty, $inner_err: ty) => {
298+
($privacy: vis, $fn_name: ident, $outer_err: ty, $inner_err: ty) => {
300299
// Not part of the public API; used in derive macros.
301300
#[doc(hidden)]
302-
pub fn $fn_name<RustT>(mut err: $outer_err) -> $outer_err {
301+
#[allow(clippy::needless_pub_self)]
302+
$privacy fn $fn_name<RustT>(mut err: $outer_err) -> $outer_err {
303303
// Safety: the assumed usage of this function guarantees that the Arc has not yet been cloned.
304304
let arc_mut = std::sync::Arc::get_mut(&mut err.0).unwrap();
305305

scylla-cql/src/deserialize/row.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,14 @@ impl<'frame, 'metadata> DeserializeRow<'frame, 'metadata> for ColumnIterator<'fr
125125
}
126126

127127
make_error_replace_rust_name!(
128+
pub(self),
128129
_typck_error_replace_rust_name,
129130
TypeCheckError,
130131
BuiltinTypeCheckError
131132
);
132133

133134
make_error_replace_rust_name!(
135+
pub,
134136
deser_error_replace_rust_name,
135137
DeserializationError,
136138
BuiltinDeserializationError

scylla-cql/src/deserialize/value.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,12 +675,14 @@ where
675675
// collections
676676

677677
make_error_replace_rust_name!(
678+
pub(crate),
678679
typck_error_replace_rust_name,
679680
TypeCheckError,
680681
BuiltinTypeCheckError
681682
);
682683

683684
make_error_replace_rust_name!(
685+
pub,
684686
deser_error_replace_rust_name,
685687
DeserializationError,
686688
BuiltinDeserializationError

scylla-cql/src/frame/request/query.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,6 @@ impl PagingStateResponse {
243243
Self::NoMorePages => ControlFlow::Break(()),
244244
}
245245
}
246-
247-
/// Swaps the paging state response with PagingStateResponse::NoMorePages.
248-
///
249-
/// Only for use in driver's inner code, as an optimisation.
250-
#[doc(hidden)]
251-
pub fn take(&mut self) -> Self {
252-
std::mem::replace(self, Self::NoMorePages)
253-
}
254246
}
255247

256248
/// The state of a paged query, i.e. where to resume fetching result rows

0 commit comments

Comments
 (0)