commit | 92935392aa828972a3d4f5bcd6aba261ed768907 | [log] [tgz] |
---|---|---|
author | Megan Batty <mgnb@google.com> | Thu Jun 23 18:58:23 2022 +0000 |
committer | CQ Bot <fuchsia-internal-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Jun 23 18:58:23 2022 +0000 |
tree | 5cff73ee91ba075f677dd11b5e17ddc8be4a6a8d | |
parent | 81b57b38c869caa6a4a406c15caaffb31b959fd2 [diff] |
[ffx][config] Separate nested ops from value maps This breaks up the logic around doing nested gets/sets/removes from the logic that does mapping and string interpolation on leaf Value files. In the process, it removes the currying and cons-ish recursion of the mapping functions, in favour of a more rust-y helper trait nested_map that you can call on either an Option<Value> or a ConfigValue, and then call with another mapping function. I think it's really nice that this puts the order of the value mapping operations in linear instead of reverse order to how they actually run. I think it makes the code much less confusing. The various nested_* things get moved again, this time to their own module, as they no longer perform mapping operations (other than NestedMap::nested_map, but I think it belongs with the other nested functions). Some of this restructuring may be useful to create a better starting point for resolving fxb/101249, but this CL is not intended to fix that on its own. Another minor inclusion is adding a file processing argument to the ffx-config-get arguments, which proved useful in finding the last problems with this CL. Bug: 101249 Change-Id: Ica85b352f3e7bb1add30d9ffbec12d88a00ee77f Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/690544 Reviewed-by: Andy Weiss <dragonbear@google.com> Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com> Reviewed-by: Steven Grady <slgrady@google.com> Fuchsia-Auto-Submit: Megan Batty <mgnb@google.com>
Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.
We expect everyone interacting with our project to respect our code of conduct.
Read more about Fuchsia's principles.
See Getting Started.
See fuchsia.dev.