From 92ffd79c36f28a90ee525f91871fdc2e4e5ea597 Mon Sep 17 00:00:00 2001 From: Ruihang Xia Date: Wed, 8 Nov 2023 16:33:45 +0800 Subject: [PATCH] remove unused params Signed-off-by: Ruihang Xia --- sqlness/src/case.rs | 6 +----- sqlness/src/interceptor.rs | 8 +------- sqlness/src/interceptor/arg.rs | 2 +- sqlness/src/interceptor/env.rs | 7 +------ 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/sqlness/src/case.rs b/sqlness/src/case.rs index 511d8ce..ed581eb 100644 --- a/sqlness/src/case.rs +++ b/sqlness/src/case.rs @@ -157,11 +157,7 @@ impl Query { let mut context = QueryContext::default(); for interceptor in &self.interceptors { - interceptor.before_execute( - &mut self.display_query, - &mut self.execute_query, - &mut context, - ); + interceptor.before_execute(&mut self.execute_query, &mut context); } context diff --git a/sqlness/src/interceptor.rs b/sqlness/src/interceptor.rs index 1ccf172..094e998 100644 --- a/sqlness/src/interceptor.rs +++ b/sqlness/src/interceptor.rs @@ -21,13 +21,7 @@ pub type InterceptorRef = Box; pub trait Interceptor { #[allow(unused_variables)] - fn before_execute( - &self, - display_query: &mut Vec, - execute_query: &mut Vec, - context: &mut QueryContext, - ) { - } + fn before_execute(&self, execute_query: &mut Vec, context: &mut QueryContext) {} #[allow(unused_variables)] fn after_execute(&self, result: &mut String) {} diff --git a/sqlness/src/interceptor/arg.rs b/sqlness/src/interceptor/arg.rs index 2e0b56f..6f313c7 100644 --- a/sqlness/src/interceptor/arg.rs +++ b/sqlness/src/interceptor/arg.rs @@ -25,7 +25,7 @@ pub struct ArgInterceptor { } impl Interceptor for ArgInterceptor { - fn before_execute(&self, _: &mut Vec, _: &mut Vec, context: &mut QueryContext) { + fn before_execute(&self, _: &mut Vec, context: &mut QueryContext) { for (key, value) in &self.args { context.context.insert(key.to_string(), value.to_string()); } diff --git a/sqlness/src/interceptor/env.rs b/sqlness/src/interceptor/env.rs index 69b9d39..e6c7259 100644 --- a/sqlness/src/interceptor/env.rs +++ b/sqlness/src/interceptor/env.rs @@ -39,12 +39,7 @@ pub struct EnvInterceptor { } impl Interceptor for EnvInterceptor { - fn before_execute( - &self, - _: &mut Vec, - execute_query: &mut Vec, - _: &mut QueryContext, - ) { + fn before_execute(&self, execute_query: &mut Vec, _: &mut QueryContext) { for line in execute_query { for (key, value) in &self.data { let rendered = line.replace(key, value);