Collects and merges properties from all versions of a spec Returns the unique properties and the latest version number
( client: &reqwest::Client, name: &str, versions: &[usize], )
| 103 | /// |
| 104 | /// Returns the unique properties and the latest version number |
| 105 | async fn collect_properties_from_versions( |
| 106 | client: &reqwest::Client, |
| 107 | name: &str, |
| 108 | versions: &[usize], |
| 109 | ) -> Result<(Vec<PropertyDefinition>, usize)> { |
| 110 | let mut all_properties: HashMap<String, PropertyDefinition> = HashMap::new(); |
| 111 | let mut latest_version = 0; |
| 112 | |
| 113 | for &version in versions { |
| 114 | println!(" Processing {}-{}/...", name, version); |
| 115 | latest_version = version; |
| 116 | |
| 117 | match process_single_version(client, name, version, &mut all_properties).await { |
| 118 | Ok(count) => { |
| 119 | if count == 0 { |
| 120 | println!(" No properties found"); |
| 121 | } else { |
| 122 | println!(" Found {} properties", count); |
| 123 | } |
| 124 | } |
| 125 | Err(e) => { |
| 126 | eprintln!(" Error processing version: {}", e); |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | let properties: Vec<PropertyDefinition> = all_properties.into_values().collect(); |
| 132 | Ok((properties, latest_version)) |
| 133 | } |
| 134 | |
| 135 | /// Processes a single spec version and adds its properties to the accumulator |
| 136 | /// |
no test coverage detected