From ea4833504206785ffeff9051a02e260fba248ced Mon Sep 17 00:00:00 2001 From: Zhi Dou Date: Wed, 20 Dec 2023 14:23:42 +0000 Subject: [PATCH] aconfig: update error message in modify_parsed_flags_based_on_mode This commit updates the error message in modify_parsed_flags_based_on_mode, when there is no certain mode flags in the corresponding library, and this change remove "." at the end of the error message to conform to existing standard in this project. Bug: 311152507 Test: atest aconfig.test Change-Id: Ib120e7f7252981bbeb6ca1cf785da24f329507b4 --- tools/aconfig/src/commands.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/aconfig/src/commands.rs b/tools/aconfig/src/commands.rs index cd53371eae..0c4f54326e 100644 --- a/tools/aconfig/src/commands.rs +++ b/tools/aconfig/src/commands.rs @@ -339,7 +339,7 @@ pub fn modify_parsed_flags_based_on_mode( } }; if modified_parsed_flags.is_empty() { - bail!("{} library contains no exported flags.", codegen_mode); + bail!("{codegen_mode} library contains no {codegen_mode} flags"); } Ok(modified_parsed_flags) @@ -653,9 +653,6 @@ mod tests { parsed_flags.parsed_flag.retain_mut(|pf| !pf.is_exported()); let error = modify_parsed_flags_based_on_mode(parsed_flags, CodegenMode::Exported).unwrap_err(); - assert_eq!( - format!("{} library contains no exported flags.", CodegenMode::Exported), - format!("{:?}", error) - ); + assert_eq!("exported library contains no exported flags", format!("{:?}", error)); } }