Skip to content

Commit 80848f2

Browse files
Rafferty97alamb
andauthored
Fix #11692: Improve doc comments within macros (#11694)
* Fix #11692: Improve doc comments within macros * Fix doc errors --------- Co-authored-by: Andrew Lamb <[email protected]>
1 parent df4e6cc commit 80848f2

File tree

4 files changed

+9
-14
lines changed

4 files changed

+9
-14
lines changed

datafusion/expr/src/test/function_stub.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,9 @@ macro_rules! create_func {
4444
/// named STATIC_$(UDAF). For example `STATIC_FirstValue`
4545
#[allow(non_upper_case_globals)]
4646
static [< STATIC_ $UDAF >]: std::sync::OnceLock<std::sync::Arc<crate::AggregateUDF>> =
47-
std::sync::OnceLock::new();
47+
std::sync::OnceLock::new();
4848

49-
/// AggregateFunction that returns a [AggregateUDF] for [$UDAF]
50-
///
51-
/// [AggregateUDF]: crate::AggregateUDF
49+
#[doc = concat!("AggregateFunction that returns a [AggregateUDF](crate::AggregateUDF) for [`", stringify!($UDAF), "`]")]
5250
pub fn $AGGREGATE_UDF_FN() -> std::sync::Arc<crate::AggregateUDF> {
5351
[< STATIC_ $UDAF >]
5452
.get_or_init(|| {

datafusion/functions-aggregate/src/macros.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,9 @@ macro_rules! create_func {
8686
/// named STATIC_$(UDAF). For example `STATIC_FirstValue`
8787
#[allow(non_upper_case_globals)]
8888
static [< STATIC_ $UDAF >]: std::sync::OnceLock<std::sync::Arc<datafusion_expr::AggregateUDF>> =
89-
std::sync::OnceLock::new();
89+
std::sync::OnceLock::new();
9090

91-
/// AggregateFunction that returns a [AggregateUDF] for [$UDAF]
92-
///
93-
/// [AggregateUDF]: datafusion_expr::AggregateUDF
91+
#[doc = concat!("AggregateFunction that returns a [`AggregateUDF`](datafusion_expr::AggregateUDF) for [`", stringify!($UDAF), "`]")]
9492
pub fn $AGGREGATE_UDF_FN() -> std::sync::Arc<datafusion_expr::AggregateUDF> {
9593
[< STATIC_ $UDAF >]
9694
.get_or_init(|| {

datafusion/functions-nested/src/macros.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ macro_rules! create_func {
9090
#[allow(non_upper_case_globals)]
9191
static [< STATIC_ $UDF >]: std::sync::OnceLock<std::sync::Arc<datafusion_expr::ScalarUDF>> =
9292
std::sync::OnceLock::new();
93-
/// ScalarFunction that returns a [`ScalarUDF`] for [`$UDF`]
94-
///
95-
/// [`ScalarUDF`]: datafusion_expr::ScalarUDF
93+
94+
#[doc = concat!("ScalarFunction that returns a [`ScalarUDF`](datafusion_expr::ScalarUDF) for ")]
95+
#[doc = stringify!($UDF)]
9696
pub fn $SCALAR_UDF_FN() -> std::sync::Arc<datafusion_expr::ScalarUDF> {
9797
[< STATIC_ $UDF >]
9898
.get_or_init(|| {

datafusion/functions/src/macros.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ macro_rules! make_udf_function {
7575
static $GNAME: std::sync::OnceLock<std::sync::Arc<datafusion_expr::ScalarUDF>> =
7676
std::sync::OnceLock::new();
7777

78-
/// Return a [`ScalarUDF`] for [`$UDF`]
79-
///
80-
/// [`ScalarUDF`]: datafusion_expr::ScalarUDF
78+
#[doc = "Return a [`ScalarUDF`](datafusion_expr::ScalarUDF) for "]
79+
#[doc = stringify!($UDF)]
8180
pub fn $NAME() -> std::sync::Arc<datafusion_expr::ScalarUDF> {
8281
$GNAME
8382
.get_or_init(|| {

0 commit comments

Comments
 (0)