From d090502eb08456c033535e4de3057a6cd936df8a Mon Sep 17 00:00:00 2001 From: daolanfler Date: Wed, 22 Nov 2023 13:51:28 +0800 Subject: [PATCH] fix: should not fail when pass config via cli --- requester/fixtures/diff.yml | 2 ++ xdiff/src/main.rs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/requester/fixtures/diff.yml b/requester/fixtures/diff.yml index ffa33c1..eb3091f 100644 --- a/requester/fixtures/diff.yml +++ b/requester/fixtures/diff.yml @@ -16,6 +16,8 @@ rust: - date - via - x-amz-cf-id + - report-to + - reporting-endpoints todo: request1: url: https://jsonplaceholder.typicode.com/todos/1 diff --git a/xdiff/src/main.rs b/xdiff/src/main.rs index 376e2cf..a460452 100644 --- a/xdiff/src/main.rs +++ b/xdiff/src/main.rs @@ -99,7 +99,10 @@ async fn parse(output: &mut Vec) -> Result<()> { } async fn run(output: &mut Vec, args: RunArgs) -> Result<()> { - let config_file = args.config.unwrap_or(get_default_config("xdiff.yml")?); + let config_file = match args.config { + Some(path) => path, + None => get_default_config("xdiff.yml")? + }; let diff_config = DiffConfig::try_load(&config_file).await?; let mut config = diff_config.get(&args.profile)?.clone();