Check if function doesn't need closure arg without associated method

This commit is contained in:
ayazhafiz 2022-06-27 23:21:56 -04:00
parent ca87faa906
commit 1c40ad6127
No known key found for this signature in database
GPG key ID: B443F7A3030C9AED
2 changed files with 71 additions and 57 deletions

View file

@ -741,17 +741,6 @@ impl<'a> LambdaSet<'a> {
}
}
pub fn member_does_not_need_closure_argument(&self, function_symbol: Symbol) -> bool {
match self.layout_for_member(function_symbol) {
ClosureRepresentation::Union {
alphabetic_order_fields,
..
} => alphabetic_order_fields.is_empty(),
ClosureRepresentation::AlphabeticOrderStruct(fields) => fields.is_empty(),
ClosureRepresentation::Other(_) => false,
}
}
pub fn layout_for_member(&self, function_symbol: Symbol) -> ClosureRepresentation<'a> {
debug_assert!(
self.set.iter().any(|(s, _)| *s == function_symbol),