From d77003fb3bfa84c6c3aa7864efbec0105497dc88 Mon Sep 17 00:00:00 2001 From: shuiyisong <113876041+shuiyisong@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:00:42 +0800 Subject: [PATCH] fix: add back mut ref (#2669) * chore: add back mut ref * chore: allow clippy complaint --- src/cmd/src/frontend.rs | 10 ++++++---- src/cmd/src/standalone.rs | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/cmd/src/frontend.rs b/src/cmd/src/frontend.rs index f665be62a4ee..429a16d85782 100644 --- a/src/cmd/src/frontend.rs +++ b/src/cmd/src/frontend.rs @@ -187,8 +187,9 @@ impl StartCommand { Ok(Options::Frontend(Box::new(opts))) } - async fn build(self, opts: FrontendOptions) -> Result { - let plugins = plugins::setup_frontend_plugins(&opts) + async fn build(self, mut opts: FrontendOptions) -> Result { + #[allow(clippy::unnecessary_mut_passed)] + let plugins = plugins::setup_frontend_plugins(&mut opts) .await .context(StartFrontendSnafu)?; @@ -303,7 +304,7 @@ mod tests { #[tokio::test] async fn test_try_from_start_command_to_anymap() { - let fe_opts = FrontendOptions { + let mut fe_opts = FrontendOptions { http: HttpOptions { disable_dashboard: false, ..Default::default() @@ -312,7 +313,8 @@ mod tests { ..Default::default() }; - let plugins = plugins::setup_frontend_plugins(&fe_opts).await.unwrap(); + #[allow(clippy::unnecessary_mut_passed)] + let plugins = plugins::setup_frontend_plugins(&mut fe_opts).await.unwrap(); let provider = plugins.get::().unwrap(); let result = provider diff --git a/src/cmd/src/standalone.rs b/src/cmd/src/standalone.rs index 8bc18d4bcae3..35d091707529 100644 --- a/src/cmd/src/standalone.rs +++ b/src/cmd/src/standalone.rs @@ -316,8 +316,9 @@ impl StartCommand { #[allow(unused_variables)] #[allow(clippy::diverging_sub_expression)] async fn build(self, opts: MixOptions) -> Result { - let fe_opts = opts.frontend; - let fe_plugins = plugins::setup_frontend_plugins(&fe_opts) + let mut fe_opts = opts.frontend; + #[allow(clippy::unnecessary_mut_passed)] + let fe_plugins = plugins::setup_frontend_plugins(&mut fe_opts) .await .context(StartFrontendSnafu)?; @@ -421,12 +422,13 @@ mod tests { #[tokio::test] async fn test_try_from_start_command_to_anymap() { - let fe_opts = FrontendOptions { + let mut fe_opts = FrontendOptions { user_provider: Some("static_user_provider:cmd:test=test".to_string()), ..Default::default() }; - let plugins = plugins::setup_frontend_plugins(&fe_opts).await.unwrap(); + #[allow(clippy::unnecessary_mut_passed)] + let plugins = plugins::setup_frontend_plugins(&mut fe_opts).await.unwrap(); let provider = plugins.get::().unwrap(); let result = provider