From: Ian Jackson Date: Mon, 22 Mar 2021 00:56:23 +0000 (+0000) Subject: shapelib refactoring: Rename find_load X-Git-Tag: otter-0.5.0~531 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=39b43df48b41a91c929731d458580a7715954fa2;p=otter.git shapelib refactoring: Rename find_load The old name was very confusing. Now there are fewer functions called `load`. Signed-off-by: Ian Jackson --- diff --git a/src/bin/otterlib.rs b/src/bin/otterlib.rs index 92b123b8..44c2d951 100644 --- a/src/bin/otterlib.rs +++ b/src/bin/otterlib.rs @@ -91,7 +91,7 @@ fn preview(items: Vec) { let mut pieces: Vec = items.into_iter().map(|it| { let spec = ItemSpec { lib: it.0, item: it.1.itemname }; (||{ - let (p, _occultable) = spec.clone().load().context("load")?; + let (p, _occultable) = spec.clone().find_load().context("load")?; // todo show occulted version too let mut uos = vec![]; p.add_ui_operations(&mut uos, &GameState::dummy(), &GPiece::dummy()) diff --git a/src/shapelib.rs b/src/shapelib.rs index c8014621..178d755d 100644 --- a/src/shapelib.rs +++ b/src/shapelib.rs @@ -291,7 +291,7 @@ impl From for PieceSpecLoaded { impl ItemSpec { #[throws(SpecError)] - pub fn load(&self) -> ItemSpecLoaded { + pub fn find_load(&self) -> ItemSpecLoaded { let lib = libs_lookup(&self.lib)?; let idata = lib.items.get(&self.item) .ok_or(SpE::LibraryItemNotFound(self.item.clone()))?; @@ -404,7 +404,7 @@ impl PieceSpec for ItemSpec { #[throws(SpecError)] fn load(&self, _: usize, _: &mut GPiece, _ir: &InstanceRef) -> PieceSpecLoaded { - self.load()?.into() + self.find_load()?.into() } } @@ -421,7 +421,7 @@ impl PieceSpec for MultiSpec { )?; let item = format!("{}{}{}", &self.prefix, item, &self.suffix); let lib = self.lib.clone(); - ItemSpec { lib, item }.load()?.into() + ItemSpec { lib, item }.find_load()?.into() } }