From 1ec0ca542db074d8bd8351b094759011f6b712a2 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Thu, 3 Oct 2024 17:12:20 +0300 Subject: [PATCH] fix: make `rustflags` optional for deserialization (#395) * fix: make `rustflags` option for deserialization closes #393 * remove breaking change --------- Co-authored-by: Lucas Nogueira --- .changes/dotcargo-optional-fields.md | 5 +++++ src/dot_cargo.rs | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changes/dotcargo-optional-fields.md diff --git a/.changes/dotcargo-optional-fields.md b/.changes/dotcargo-optional-fields.md new file mode 100644 index 00000000..1c2fe766 --- /dev/null +++ b/.changes/dotcargo-optional-fields.md @@ -0,0 +1,5 @@ +--- +"cargo-mobile2": "patch" +--- + +Fix deserializing targets from `.cargo/config.toml` if the target's `rustflags` field is not specified diff --git a/src/dot_cargo.rs b/src/dot_cargo.rs index df476665..d12cd794 100644 --- a/src/dot_cargo.rs +++ b/src/dot_cargo.rs @@ -64,6 +64,7 @@ impl DotCargoBuild { #[derive(Debug, Default, Deserialize, Serialize)] pub struct DotCargoTarget { pub linker: Option, + #[serde(default)] pub rustflags: Vec, }