From 6ce62595a6d2d1044b284b121ab8003cc20bc808 Mon Sep 17 00:00:00 2001 From: Blaine Heffron Date: Thu, 6 Jun 2024 11:00:05 -0400 Subject: [PATCH] fix incorrect filter logic (#1360) --- cmd/crates/soroban-spec-typescript/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/crates/soroban-spec-typescript/src/lib.rs b/cmd/crates/soroban-spec-typescript/src/lib.rs index f9e765253..4ff925476 100644 --- a/cmd/crates/soroban-spec-typescript/src/lib.rs +++ b/cmd/crates/soroban-spec-typescript/src/lib.rs @@ -99,7 +99,7 @@ pub fn generate(spec: &[ScSpecEntry]) -> String { // 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("__"))) + .filter(|entry| !matches!(entry, Entry::Function { name, .. } if name.starts_with("__"))) .partition(|entry| matches!(entry, Entry::Function { .. })); let top = other.iter().map(entry_to_method_type).join("\n"); let bottom = generate_class(&fns, spec);