From bf3cc5c13cfac20c00bcd5dac28ae65399950a72 Mon Sep 17 00:00:00 2001 From: DamonXue Date: Wed, 26 Feb 2025 21:08:44 +0800 Subject: [PATCH] fix: enforce condition element presence in Functions deserialization feat: add binary target for rustfs --- iam/src/policy/function.rs | 6 +++--- rustfs/Cargo.toml | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/iam/src/policy/function.rs b/iam/src/policy/function.rs index 27870d15..03a020dc 100644 --- a/iam/src/policy/function.rs +++ b/iam/src/policy/function.rs @@ -131,9 +131,9 @@ impl<'de> Deserialize<'de> for Functions { } } - // if inner_data.is_empty() { - // return Err(Error::custom("has no condition element")); - // } + if inner_data.is_empty() { + return Err(Error::custom("has no condition element")); + } Ok(inner_data) } diff --git a/rustfs/Cargo.toml b/rustfs/Cargo.toml index 8b790691..4097167a 100644 --- a/rustfs/Cargo.toml +++ b/rustfs/Cargo.toml @@ -7,6 +7,9 @@ repository.workspace = true rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[[bin]] +name = "rustfs" +path = "src/main.rs" [lints] workspace = true