chiark / gitweb /
rename enum Outline
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Feb 2021 13:42:47 +0000 (13:42 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Feb 2021 13:42:47 +0000 (13:42 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/hand.rs
src/pieces.rs
src/shapelib.rs
src/spec.rs

index a9a8fd34cc1730f518db249f789548c5436c03ae..7761751ff7a6ff86033f5b98da96d2e8e99bd0a8 100644 (file)
@@ -50,7 +50,7 @@ impl PieceSpec for piece_specs::Hand {
       edge_width: self.edge_width,
     };
     let shape = match self.shape {
-      OutlineRepr::Rectangle(r) => r,
+      Outline::Rectangle(r) => r,
       _ => throw!(SpecError::UnsupportedShape),
     };
     let shape = GenericSimpleShape::new(
index 5a2383f82824b15ac9b8652734d1ea5dd7c2859a..4615c79f9c0928a0117cb87b8b55e0c610a6f6f7 100644 (file)
@@ -20,7 +20,7 @@ pub struct GenericSimpleShape<Desc, Outl> {
   pub itemname: String,
   pub outline: Outl,
 }
-pub type SimpleShape = GenericSimpleShape<Html, OutlineRepr>;
+pub type SimpleShape = GenericSimpleShape<Html, Outline>;
 
 pub const SELECT_SCALE: f64 = 1.1;
 
index e3145a75a4f8e10ca2d680fe5f865e687e54861e..a7e68a36b93ae11f2a4436c9fda41f393189b467 100644 (file)
@@ -26,7 +26,7 @@ pub struct GroupData {
 #[typetag::deserialize(tag="outline")]
 pub trait OutlineDefn: Debug + Sync + Send {
   fn check(&self, lgi: &GroupData) -> Result<(),LLE>;
-  fn load(&self, lgi: &GroupData) -> Result<OutlineRepr,IE>;
+  fn load(&self, lgi: &GroupData) -> Result<Outline,IE>;
 }
 
 #[derive(Debug)]
@@ -126,7 +126,7 @@ struct Item {
   desc_hidden: DescId,
   svgs: IndexVec<SvgId, Html>,
   descs: IndexVec<DescId, Html>,
-  outline: OutlineRepr,
+  outline: Outline,
 }
 
 #[derive(Debug,Clone,Serialize,Deserialize,Eq,PartialEq,Ord,PartialOrd)]
@@ -518,7 +518,7 @@ struct CircleDefn { }
 impl OutlineDefn for CircleDefn {
   #[throws(LibraryLoadError)]
   fn check(&self, lgd: &GroupData) { Self::get_size(lgd)?; }
-  fn load(&self, lgd: &GroupData) -> Result<OutlineRepr,IE> {
+  fn load(&self, lgd: &GroupData) -> Result<Outline,IE> {
     Ok(Circle {
       diam: Self::get_size(lgd).map_err(|e| e.ought())?,
     }.into())
@@ -567,7 +567,7 @@ struct SquareDefn { }
 impl OutlineDefn for SquareDefn {
   #[throws(LibraryLoadError)]
   fn check(&self, lgd: &GroupData) { Self::get(lgd)?; }
-  fn load(&self, lgd: &GroupData) -> Result<OutlineRepr,IE> {
+  fn load(&self, lgd: &GroupData) -> Result<Outline,IE> {
     Ok(
       Self::get(lgd).map_err(|e| e.ought())?.into()
     )
index 5f333cd9d4b7018cd19b25dfdfc4c550ff77e737..3064a2ebcd392aa40391daed876629a74f7e0df0 100644 (file)
@@ -202,7 +202,7 @@ mod outline {
   #[enum_dispatch(OutlineTrait)]
   #[derive(Clone,Debug,Serialize,Deserialize)]
   #[serde(tag="type")]
-  pub enum OutlineRepr {
+  pub enum Outline {
     Circle,
     #[serde(alias="Square")] Rectangle,
   }
@@ -241,7 +241,7 @@ pub mod piece_specs {
     pub colour: String,
     pub edge: Option<ColourSpec>,
     pub edge_width: Option<f64>,
-    pub shape: OutlineRepr,
+    pub shape: Outline,
   }
 }