Now inert pieces can be occultable too. Currently this is meaningless
since we only call load_inert when resolving the occultation
for *another* piece, where we discard the occultation information.
But that is going to change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-> Result<PieceSpecLoaded, SpecError>;
/// Used when a piece wants to use another for its occulted form
fn load_inert(&self, _ig: &Instance, _:SpecDepth)
- -> Result<Box<dyn InertPieceTrait>, SpecError> {
+ -> Result<SpecLoaded<dyn InertPieceTrait>, SpecError> {
throw!(SpE::ComplexPieceWhereInertRequired)
}
}
}
#[throws(SpecError)]
fn load_inert(&self, ig: &Instance, depth: SpecDepth)
- -> Box<dyn InertPieceTrait> {
+ -> SpecLoaded<dyn InertPieceTrait> {
self.resolve(&ig.pcaliases)?.load_inert(ig, self.new_depth(depth)?)?
}
}
Err(SpecError::AliasNotFound) => { },
Err(e) => throw!(e),
Ok(p) => {
- let p = p.into();
+ let p = p.p.into();
back = Some(p);
}
}
}
#[throws(SpecError)]
fn load_inert(&self, ig: &Instance, depth: SpecDepth)
- -> Box<dyn InertPieceTrait> {
- self.find_load(ig,depth)?.0 as Box<dyn InertPieceTrait>
+ -> SpecLoaded<dyn InertPieceTrait> {
+ let (p, occultable) = self.find_load(ig,depth)?;
+ SpecLoaded { p: p as _, occultable }
}
}