aboutsummaryrefslogtreecommitdiff
path: root/llvm_tools/patch_sync/src/patch_parsing.rs
diff options
context:
space:
mode:
authorJordan R Abrahams <ajordanr@google.com>2022-01-19 23:51:36 +0000
committerCommit Bot <commit-bot@chromium.org>2022-01-22 01:16:33 +0000
commit86d317a4fdb5f603df849b7056815db5ebe30804 (patch)
treecdb8d8de13f3585d6471ece3ccdfaab72b498649 /llvm_tools/patch_sync/src/patch_parsing.rs
parentf96fffcd3c3bcfa3af9fed129aed3466ee9adc1b (diff)
downloadtoolchain-utils-86d317a4fdb5f603df849b7056815db5ebe30804.tar.gz
patch_sync: Fix for Rust 1.55 compat, cli patch
On chrotomation, we still use Rust 1.55. Rust 1.55 does not have the "from" implementation for arrays, so we must build the BTrees by hand. Additionally, this removes the requirement for having the review strings be set. BUG=b:209493133 TEST=cargo check Change-Id: I6bc16e96cd56775c8c80667395f3dc3fb4857356 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3403387 Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com>
Diffstat (limited to 'llvm_tools/patch_sync/src/patch_parsing.rs')
-rw-r--r--llvm_tools/patch_sync/src/patch_parsing.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm_tools/patch_sync/src/patch_parsing.rs b/llvm_tools/patch_sync/src/patch_parsing.rs
index 2f0fbc87..581b1899 100644
--- a/llvm_tools/patch_sync/src/patch_parsing.rs
+++ b/llvm_tools/patch_sync/src/patch_parsing.rs
@@ -253,13 +253,13 @@ pub fn new_patches(
let old_collection = old_collection.filter_patches(|p| old_collection.patch_exists(p));
cur_collection.subtract(&old_collection)?
};
- let new_patches = new_patches.map_patches(|p| PatchDictSchema {
- platforms: BTreeSet::from(["android".to_string(), "chromiumos".to_string()])
- .union(&p.platforms)
- .cloned()
- .collect(),
-
- ..p.to_owned()
+ let new_patches = new_patches.map_patches(|p| {
+ let mut platforms = BTreeSet::new();
+ platforms.extend(["android".to_string(), "chromiumos".to_string()]);
+ PatchDictSchema {
+ platforms: platforms.union(&p.platforms).cloned().collect(),
+ ..p.to_owned()
+ }
});
Ok((cur_collection, new_patches))
}