Extract marking s builtin into header type method

This commit is contained in:
Agus Zubiaga 2024-04-27 22:27:50 -03:00
parent 8c62640b97
commit 87a279dc2c
No known key found for this signature in database
2 changed files with 15 additions and 15 deletions

View file

@ -103,6 +103,19 @@ impl<'a> HeaderType<'a> {
}
}
}
pub fn to_maybe_builtin(self, module_id: ModuleId) -> Self {
match self {
HeaderType::Interface { name, exposes } if module_id.is_builtin() => {
HeaderType::Builtin {
name,
exposes,
generates_with: &[],
}
}
_ => self,
}
}
}
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]