From: Ian Jackson Date: Fri, 15 Apr 2022 17:38:00 +0000 (+0100) Subject: Provide load_inert for SimplePieceSpec X-Git-Tag: otter-1.1.0~600 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ea082269a8a44e4cdadeea5de9aca1b6e9a663b4;p=otter.git Provide load_inert for SimplePieceSpec This will let us use these as backgrounds for dice. Signed-off-by: Ian Jackson --- diff --git a/src/pieces.rs b/src/pieces.rs index 37297dc8..ab38f3c5 100644 --- a/src/pieces.rs +++ b/src/pieces.rs @@ -365,6 +365,15 @@ macro_rules! impl_PieceSpec_for_SimplePieceSpec { { $ty:ty } => { occultable: None, } } + + #[throws(SpecError)] + fn load_inert(&self, _ig: &Instance, _:SpecDepth) + -> SpecLoaded { + SpecLoaded { + p: Box::new(self.load_raw()?.0) as _, + occultable: None + } + } } } }