From: Ian Jackson Date: Sun, 8 May 2022 11:03:42 +0000 (+0100) Subject: mformat 2: Rename various functions to have _mf1 X-Git-Tag: otter-1.1.0~247 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a1c7ea572e420163db154318e6e62037fa3519d9;p=otter.git mformat 2: Rename various functions to have _mf1 These entrypoints are going to be specific to format 1. Signed-off-by: Ian Jackson --- 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()