Skip to content

Commit

Permalink
remove unused params
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <[email protected]>
  • Loading branch information
waynexia committed Nov 8, 2023
1 parent b6ded50 commit 92ffd79
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
6 changes: 1 addition & 5 deletions sqlness/src/case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions sqlness/src/interceptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ pub type InterceptorRef = Box<dyn Interceptor>;

pub trait Interceptor {
#[allow(unused_variables)]
fn before_execute(
&self,
display_query: &mut Vec<String>,
execute_query: &mut Vec<String>,
context: &mut QueryContext,
) {
}
fn before_execute(&self, execute_query: &mut Vec<String>, context: &mut QueryContext) {}

#[allow(unused_variables)]
fn after_execute(&self, result: &mut String) {}
Expand Down
2 changes: 1 addition & 1 deletion sqlness/src/interceptor/arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct ArgInterceptor {
}

impl Interceptor for ArgInterceptor {
fn before_execute(&self, _: &mut Vec<String>, _: &mut Vec<String>, context: &mut QueryContext) {
fn before_execute(&self, _: &mut Vec<String>, context: &mut QueryContext) {
for (key, value) in &self.args {
context.context.insert(key.to_string(), value.to_string());
}
Expand Down
7 changes: 1 addition & 6 deletions sqlness/src/interceptor/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ pub struct EnvInterceptor {
}

impl Interceptor for EnvInterceptor {
fn before_execute(
&self,
_: &mut Vec<String>,
execute_query: &mut Vec<String>,
_: &mut QueryContext,
) {
fn before_execute(&self, execute_query: &mut Vec<String>, _: &mut QueryContext) {
for line in execute_query {
for (key, value) in &self.data {
let rendered = line.replace(key, value);
Expand Down

0 comments on commit 92ffd79

Please sign in to comment.