diff options
| author | 2024-01-08 17:26:59 +0100 | |
|---|---|---|
| committer | 2024-01-08 17:26:59 +0100 | |
| commit | 32c6ef5e252b7e8e724df47a694f085fa19c50cd (patch) | |
| tree | 7011733d0d74832ad8cfd7d11b22da37e53aa020 | |
| parent | 32fd2dee4f5584f95f8169d0d06c4c7057b974c1 (diff) | |
aconfig: simplify is_valid_container
str::split always returns at least one item (the entire string) if the
delimiter is not found. Simplify the implementation of
is_valid_container accordingly.
Bug: N/A
Test: atest aconfig.test
Change-Id: I3e92035309a7b019912710e42e69f9bdfa538795
| -rw-r--r-- | tools/aconfig/src/codegen/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/aconfig/src/codegen/mod.rs b/tools/aconfig/src/codegen/mod.rs index 4af1327303..64ffa8b379 100644 --- a/tools/aconfig/src/codegen/mod.rs +++ b/tools/aconfig/src/codegen/mod.rs @@ -44,7 +44,7 @@ pub fn is_valid_package_ident(s: &str) -> bool { } pub fn is_valid_container_ident(s: &str) -> bool { - is_valid_name_ident(s) || s.split('.').all(is_valid_name_ident) + s.split('.').all(is_valid_name_ident) } pub fn create_device_config_ident(package: &str, flag_name: &str) -> Result<String> { |