Skip to content

Commit

Permalink
fix: add back mut ref (#2669)
Browse files Browse the repository at this point in the history
* chore: add back mut ref

* chore: allow clippy complaint
  • Loading branch information
shuiyisong authored Oct 31, 2023
1 parent 54ed752 commit d77003f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/cmd/src/frontend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ impl StartCommand {
Ok(Options::Frontend(Box::new(opts)))
}

async fn build(self, opts: FrontendOptions) -> Result<Instance> {
let plugins = plugins::setup_frontend_plugins(&opts)
async fn build(self, mut opts: FrontendOptions) -> Result<Instance> {
#[allow(clippy::unnecessary_mut_passed)]
let plugins = plugins::setup_frontend_plugins(&mut opts)
.await
.context(StartFrontendSnafu)?;

Expand Down Expand Up @@ -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()
Expand All @@ -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::<UserProviderRef>().unwrap();
let result = provider
Expand Down
10 changes: 6 additions & 4 deletions src/cmd/src/standalone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,9 @@ impl StartCommand {
#[allow(unused_variables)]
#[allow(clippy::diverging_sub_expression)]
async fn build(self, opts: MixOptions) -> Result<Instance> {
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)?;

Expand Down Expand Up @@ -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::<UserProviderRef>().unwrap();
let result = provider
Expand Down

0 comments on commit d77003f

Please sign in to comment.