From a6366dc1ad64f8891c43f8278efad54950bb1ce1 Mon Sep 17 00:00:00 2001 From: Blaine Heffron Date: Wed, 5 Jun 2024 12:37:05 -0400 Subject: [PATCH] remove extraneous iterator conversions --- cmd/crates/soroban-spec-typescript/src/lib.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd/crates/soroban-spec-typescript/src/lib.rs b/cmd/crates/soroban-spec-typescript/src/lib.rs index e57e65a806..f9e7652530 100644 --- a/cmd/crates/soroban-spec-typescript/src/lib.rs +++ b/cmd/crates/soroban-spec-typescript/src/lib.rs @@ -96,13 +96,10 @@ pub fn generate(spec: &[ScSpecEntry]) -> String { cases: vec![], }); } - // Filter out function entries with names that start with "__" - let filtered_collected: Vec<_> = collected + // Filter out function entries with names that start with "__" and partition the results + let (fns, other): (Vec<_>, Vec<_>) = collected .into_iter() .filter(|entry| matches!(entry, Entry::Function { name, .. } if !name.starts_with("__"))) - .collect(); - let (fns, other): (Vec<_>, Vec<_>) = filtered_collected - .into_iter() .partition(|entry| matches!(entry, Entry::Function { .. })); let top = other.iter().map(entry_to_method_type).join("\n"); let bottom = generate_class(&fns, spec);