diff --git a/src/functions.rs b/src/functions.rs index d856ef6..eb54688 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -342,7 +342,7 @@ pub trait Aggregate where T: ToResult { /// "step" function called once for each row in an aggregate group. fn step(&self, &mut Context, &mut A) -> Result<()>; /// Computes and returns the final result. - fn finalize(&self, &A) -> Result; + fn finalize(&self, A) -> Result; } @@ -549,7 +549,7 @@ impl InnerConnection { let ac: *mut A = *pac; let a = Box::from_raw(mem::transmute(ac)); // to be freed - match (*boxed_aggr).finalize(&a) { + match (*boxed_aggr).finalize(*a) { Ok(r) => r.set_result(ctx), Err(Error::SqliteFailure(err, s)) => { ffi::sqlite3_result_error_code(ctx, err.extended_code); @@ -783,8 +783,8 @@ mod test { Ok(()) } - fn finalize(&self, sum: &i64) -> Result { - Ok(*sum) + fn finalize(&self, sum: i64) -> Result { + Ok(sum) } }