From 310ca7022a73e3b240f368425d3e989f6fc51d6a Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Thu, 4 Jan 2024 19:10:13 +0100 Subject: [PATCH] skip serializing pip check --- src/recipe/parser/test.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/recipe/parser/test.rs b/src/recipe/parser/test.rs index e1c44e05a..845f49be0 100644 --- a/src/recipe/parser/test.rs +++ b/src/recipe/parser/test.rs @@ -53,11 +53,20 @@ impl CommandsTestFiles { } } +fn default_pip_check() -> bool { + true +} + +fn is_true(value: &bool) -> bool { + *value +} + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct PythonTest { /// List of imports to test pub imports: Vec, - /// Wether to run `pip check` or not + /// Wether to run `pip check` or not (default to true) + #[serde(default = "default_pip_check", skip_serializing_if = "is_true")] pub pip_check: bool, }