From abbf3291ef8a966f3d250627b9c6a38e51188c8d Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 6 Oct 2023 21:31:50 -0400 Subject: [PATCH] Use proper var names in trait definition The underscores are too confusing, plus IDE automatically copies them into the implementation, and the `_` is not what most people would expect. --- src/functions.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/functions.rs b/src/functions.rs index 7d9eeb7..6dfcb88 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -272,11 +272,11 @@ where /// call to [`step()`](Aggregate::step) to set up the context for an /// invocation of the function. (Note: `init()` will not be called if /// there are no rows.) - fn init(&self, _: &mut Context<'_>) -> Result; + fn init(&self, ctx: &mut Context<'_>) -> Result; /// "step" function called once for each row in an aggregate group. May be /// called 0 times if there are no rows. - fn step(&self, _: &mut Context<'_>, _: &mut A) -> Result<()>; + fn step(&self, ctx: &mut Context<'_>, acc: &mut A) -> Result<()>; /// Computes and returns the final result. Will be called exactly once for /// each invocation of the function. If [`step()`](Aggregate::step) was @@ -287,7 +287,7 @@ where /// given `None`. /// /// The passed context will have no arguments. - fn finalize(&self, _: &mut Context<'_>, _: Option) -> Result; + fn finalize(&self, ctx: &mut Context<'_>, acc: Option) -> Result; } /// `WindowAggregate` is the callback interface for @@ -301,10 +301,10 @@ where { /// Returns the current value of the aggregate. Unlike xFinal, the /// implementation should not delete any context. - fn value(&self, _: Option<&A>) -> Result; + fn value(&self, acc: Option<&A>) -> Result; /// Removes a row from the current window. - fn inverse(&self, _: &mut Context<'_>, _: &mut A) -> Result<()>; + fn inverse(&self, ctx: &mut Context<'_>, acc: &mut A) -> Result<()>; } bitflags::bitflags! {