Skip to content

Commit 4c154ba

Browse files
committed
scylla-macros: Replace derive macros docs with stubs
When both original item and re-export are documented, documentations are merged. Before this commit, both original item and re-export were documented - identically or at least very similarly. This caused docs in scylla-cql crate to be copy-pasted twice. Replace docs with stubs pointing to the scylla crate to avoid it and point users to proper documentation.
1 parent 60392ed commit 4c154ba

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

scylla-macros/src/lib.rs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ mod value_list;
99

1010
mod serialize;
1111

12-
/// See the documentation for this item in the `scylla` crate.
12+
/// Documentation for this macro can only be found
13+
/// in `scylla` crate - not in scylla-macros nor in scylla-cql.
14+
/// This is because of rustdocs limitations that are hard to explain here.
1315
#[proc_macro_derive(SerializeCql, attributes(scylla))]
1416
pub fn serialize_cql_derive(tokens_input: TokenStream) -> TokenStream {
1517
match serialize::cql::derive_serialize_cql(tokens_input) {
@@ -18,7 +20,9 @@ pub fn serialize_cql_derive(tokens_input: TokenStream) -> TokenStream {
1820
}
1921
}
2022

21-
/// See the documentation for this item in the `scylla` crate.
23+
/// Documentation for this macro can only be found
24+
/// in `scylla` crate - not in scylla-macros nor in scylla-cql.
25+
/// This is because of rustdocs limitations that are hard to explain here.
2226
#[proc_macro_derive(SerializeRow, attributes(scylla))]
2327
pub fn serialize_row_derive(tokens_input: TokenStream) -> TokenStream {
2428
match serialize::row::derive_serialize_row(tokens_input) {
@@ -27,32 +31,36 @@ pub fn serialize_row_derive(tokens_input: TokenStream) -> TokenStream {
2731
}
2832
}
2933

30-
/// #[derive(FromRow)] derives FromRow for struct
31-
/// Works only on simple structs without generics etc
34+
/// Documentation for this macro can only be found
35+
/// in `scylla` crate - not in scylla-macros nor in scylla-cql.
36+
/// This is because of rustdocs limitations that are hard to explain here.
3237
#[proc_macro_derive(FromRow, attributes(scylla_crate))]
3338
pub fn from_row_derive(tokens_input: TokenStream) -> TokenStream {
3439
let res = from_row::from_row_derive(tokens_input);
3540
res.unwrap_or_else(|e| e.into_compile_error().into())
3641
}
3742

38-
/// #[derive(FromUserType)] allows to parse a struct as User Defined Type
39-
/// Works only on simple structs without generics etc
43+
/// Documentation for this macro can only be found
44+
/// in `scylla` crate - not in scylla-macros nor in scylla-cql.
45+
/// This is because of rustdocs limitations that are hard to explain here.
4046
#[proc_macro_derive(FromUserType, attributes(scylla_crate))]
4147
pub fn from_user_type_derive(tokens_input: TokenStream) -> TokenStream {
4248
let res = from_user_type::from_user_type_derive(tokens_input);
4349
res.unwrap_or_else(|e| e.into_compile_error().into())
4450
}
4551

46-
/// #[derive(IntoUserType)] allows to parse a struct as User Defined Type
47-
/// Works only on simple structs without generics etc
52+
/// Documentation for this macro can only be found
53+
/// in `scylla` crate - not in scylla-macros nor in scylla-cql.
54+
/// This is because of rustdocs limitations that are hard to explain here.
4855
#[proc_macro_derive(IntoUserType, attributes(scylla_crate))]
4956
pub fn into_user_type_derive(tokens_input: TokenStream) -> TokenStream {
5057
let res = into_user_type::into_user_type_derive(tokens_input);
5158
res.unwrap_or_else(|e| e.into_compile_error().into())
5259
}
5360

54-
/// #[derive(ValueList)] derives ValueList for struct
55-
/// Works only on simple structs without generics etc
61+
/// Documentation for this macro can only be found
62+
/// in `scylla` crate - not in scylla-macros nor in scylla-cql.
63+
/// This is because of rustdocs limitations that are hard to explain here.
5664
#[proc_macro_derive(ValueList, attributes(scylla_crate))]
5765
pub fn value_list_derive(tokens_input: TokenStream) -> TokenStream {
5866
let res = value_list::value_list_derive(tokens_input);

0 commit comments

Comments
 (0)