label borrowing

This commit is contained in:
Christian Hughes 2025-07-09 19:26:50 -05:00
parent c9c8964857
commit ffb059d3e7
2 changed files with 7 additions and 1 deletions

View File

@ -150,6 +150,12 @@ macro_rules! define_label {
}
}
impl ::core::borrow::Borrow<dyn $label_trait_name> for $crate::intern::Interned<dyn $label_trait_name> {
fn borrow(&self) -> &dyn $label_trait_name {
&**self
}
}
impl $crate::intern::Internable for dyn $label_trait_name {
fn leak(&self) -> &'static Self {
$crate::label::Box::leak(self.dyn_clone())

View File

@ -841,7 +841,7 @@ impl ScheduleGraph {
/// Returns `true` if the given system set is part of the graph. Otherwise, returns `false`.
pub fn contains_set(&self, set: impl SystemSet) -> bool {
self.system_sets.ids.contains_key(&set.intern())
self.system_sets.ids.contains_key(&set as &dyn SystemSet)
}
/// Returns the system at the given [`NodeId`].