Implement [more] app header formatting

Also, refactor out a utility method to format a Collection. This method can currently
replace some of the formatting done in module headers - but the goal is eventually
to be able to replace the code in fmt_list as well, such that there is 'one true way'
to format collections.
This commit is contained in:
Joshua Warner 2021-11-22 16:45:21 -08:00
parent f02ed47f31
commit 24f7692a73
9 changed files with 322 additions and 137 deletions

View file

@ -1743,7 +1743,7 @@ fn update<'a>(
match header_extra {
App { to_platform } => {
debug_assert!(matches!(state.platform_path, PlatformPath::NotSpecified));
state.platform_path = PlatformPath::Valid(to_platform.clone());
state.platform_path = PlatformPath::Valid(to_platform);
}
PkgConfig { main_for_host, .. } => {
debug_assert!(matches!(state.platform_data, None));
@ -2628,7 +2628,7 @@ fn parse_header<'a>(
packages,
exposes: header.provides.items,
imports: header.imports.items,
to_platform: Some(header.to.value.clone()),
to_platform: Some(header.to.value),
};
let (module_id, app_module_header_msg) = send_header(