From a1c7ea572e420163db154318e6e62037fa3519d9 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 8 May 2022 12:03:42 +0100 Subject: [PATCH] mformat 2: Rename various functions to have _mf1 These entrypoints are going to be specific to format 1. Signed-off-by: Ian Jackson --- src/shapelib.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/shapelib.rs b/src/shapelib.rs index aa96ab0c..833d209a 100644 --- a/src/shapelib.rs +++ b/src/shapelib.rs @@ -38,7 +38,8 @@ pub trait OutlineDefn: Debug + Sync + Send + 'static { /// Called to *check* the group configuration before load, but /// with a dummy svg_gz of [1,1]. That must correctly predict /// success with other sizes. - fn load(&self, lgi: &GroupData, svg_sz: PosC) -> Result; + fn load_mf1(&self, lgi: &GroupData, svg_sz: PosC) + -> Result; } #[derive(Debug,Clone,Copy)] pub struct ShapeCalculable { } @@ -575,7 +576,7 @@ impl Catalogue { impl FaceTransform { #[throws(LLE)] - fn from_group(d: &GroupDetails) -> Self { + fn from_group_mf1(d: &GroupDetails) -> Self { // by this point d.size has already been scaled by scale let scale = if ! d.orig_size.is_empty() && ! d.size.is_empty() { izip!(&d.orig_size, &d.size) @@ -643,8 +644,8 @@ impl GroupData { #[throws(LibraryLoadError)] fn load_shape(&self, svg_sz: PosC) -> (FaceTransform, Outline) { - let xform = FaceTransform::from_group(&self.d)?; - let outline = self.d.outline.load(&self, svg_sz)?; + let xform = FaceTransform::from_group_mf1(&self.d)?; + let outline = self.d.outline.load_mf1(&self, svg_sz)?; (xform, outline) } } @@ -706,7 +707,7 @@ struct RectDefn { } #[typetag::deserialize(name="Rect")] impl OutlineDefn for RectDefn { #[throws(LibraryLoadError)] - fn load(&self, lgd: &GroupData, _svg_sz: PosC) -> Outline { + fn load_mf1(&self, lgd: &GroupData, _svg_sz: PosC) -> Outline { Self::get(lgd)?.into() } } @@ -744,7 +745,7 @@ struct CircleDefn { } #[typetag::deserialize(name="Circle")] impl OutlineDefn for CircleDefn { #[throws(LibraryLoadError)] - fn load(&self, lgd: &GroupData, _svg_sz: PosC) -> Outline { + fn load_mf1(&self, lgd: &GroupData, _svg_sz: PosC) -> Outline { CircleShape { diam: Self::get_size(lgd)?, }.into() -- 2.30.2