Replaced equality check with enum

This commit is contained in:
J.Teeuwissen 2023-01-06 08:55:13 +01:00
parent be73d3cfc4
commit a11d94aee2
No known key found for this signature in database
GPG key ID: DB5F7A1ED8D478AD

View file

@ -626,9 +626,8 @@ impl<'a> BorrowInfState<'a> {
// own the closure environment if the function needs to own it
let function_env_position = op.function_arity();
if let Some(false) = function_ps
.get(function_env_position)
.map(|p| p.ownership == Ownership::Borrowed)
if let Some(Ownership::Owned) =
function_ps.get(function_env_position).map(|p| p.ownership)
{
self.own_var(passed_function.captured_environment);
}