Skip to content

Commit 0c6e1b4

Browse files
Copilotfengmk2
andcommitted
fix: resolve cargo fmt formatting issues
Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com>
1 parent 93f15ad commit 0c6e1b4

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

crates/vite_task/src/fmt.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ use crate::schedule::ExecutionPlan;
77
use crate::{Error, ResolveCommandResult, Workspace};
88

99
#[tracing::instrument(skip(resolve_fmt_command, workspace))]
10-
pub async fn fmt<
11-
Fmt: Future<Output = Result<ResolveCommandResult, Error>>,
12-
FmtFn: Fn() -> Fmt,
13-
>(
10+
pub async fn fmt<Fmt: Future<Output = Result<ResolveCommandResult, Error>>, FmtFn: Fn() -> Fmt>(
1411
resolve_fmt_command: FmtFn,
1512
workspace: &mut Workspace,
1613
args: &Vec<String>,
@@ -22,4 +19,4 @@ pub async fn fmt<
2219
task_graph.add_node(resolved_task);
2320
ExecutionPlan::plan(task_graph, false)?.execute(workspace).await?;
2421
Ok(())
25-
}
22+
}

crates/vite_task/src/lib.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,22 @@ mod tests {
379379

380380
#[test]
381381
fn test_args_fmt_command_with_args() {
382-
let args =
383-
Args::try_parse_from(&["vite-plus", "fmt", "--", "--check", "--ignore-path", ".gitignore"]).unwrap();
382+
let args = Args::try_parse_from(&[
383+
"vite-plus",
384+
"fmt",
385+
"--",
386+
"--check",
387+
"--ignore-path",
388+
".gitignore",
389+
])
390+
.unwrap();
384391
assert_eq!(args.task, None);
385392
assert!(args.task_args.is_empty());
386393
if let Some(Commands::Fmt { args }) = &args.commands {
387-
assert_eq!(args, &vec!["--check".to_string(), "--ignore-path".to_string(), ".gitignore".to_string()]);
394+
assert_eq!(
395+
args,
396+
&vec!["--check".to_string(), "--ignore-path".to_string(), ".gitignore".to_string()]
397+
);
388398
} else {
389399
panic!("Expected Fmt command");
390400
}

0 commit comments

Comments
 (0)