From 1d900a6a3c42a51f5425d1ecd4831f778a51b9c6 Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Wed, 18 Dec 2019 15:56:24 -0800 Subject: [PATCH] Update benchmarks to use new CLI API --- benches/build.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/benches/build.rs b/benches/build.rs index 5b3a918d..802f43a3 100644 --- a/benches/build.rs +++ b/benches/build.rs @@ -3,7 +3,7 @@ use std::path::Path; use criterion::{criterion_group, criterion_main, BatchSize, Criterion}; use tempfile::{tempdir, TempDir}; -use librojo::commands::{build, BuildOptions}; +use librojo::cli::{build, BuildCommand}; pub fn benchmark_small_place(c: &mut Criterion) { bench_build_place(c, "Small Place", "test-projects/benchmark_small_place") @@ -20,7 +20,7 @@ fn bench_build_place(c: &mut Criterion, name: &str, path: &str) { group.bench_function("build", |b| { b.iter_batched( || place_setup(path), - |(_dir, options)| build(&options).unwrap(), + |(_dir, options)| build(options).unwrap(), BatchSize::SmallInput, ) }); @@ -28,15 +28,14 @@ fn bench_build_place(c: &mut Criterion, name: &str, path: &str) { group.finish(); } -fn place_setup>(input_path: P) -> (TempDir, BuildOptions) { +fn place_setup>(input_path: P) -> (TempDir, BuildCommand) { let dir = tempdir().unwrap(); let input = input_path.as_ref().to_path_buf(); - let output_file = dir.path().join("output.rbxlx"); + let output = dir.path().join("output.rbxlx"); - let options = BuildOptions { - fuzzy_project_path: input, - output_file, - output_kind: None, + let options = BuildCommand { + project: input, + output, }; (dir, options)