From 3cccab517a3527c4caa8aa6aeb9020a56c61a3e4 Mon Sep 17 00:00:00 2001 From: Colin Rofls Date: Mon, 28 Jun 2021 12:29:13 -0400 Subject: [PATCH] Rename ufo.rs to font.rs --- src/{ufo.rs => font.rs} | 4 ++-- src/layer.rs | 3 ++- src/lib.rs | 6 +++--- src/upconversion.rs | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) rename src/{ufo.rs => font.rs} (99%) diff --git a/src/ufo.rs b/src/font.rs similarity index 99% rename from src/ufo.rs rename to src/font.rs index d583f377..864ecb7d 100644 --- a/src/ufo.rs +++ b/src/font.rs @@ -157,12 +157,12 @@ impl Default for MetaInfo { } impl Font { - /// Create a new `Ufo`. + /// Create a new, empty `Font` object. pub fn new() -> Self { Font::default() } - /// Create a new `Ufo` only with certain fields + /// Create a new `Font` only with certain fields. pub fn with_fields(data_request: DataRequest) -> Self { let mut ufo = Self::new(); ufo.data_request = data_request; diff --git a/src/layer.rs b/src/layer.rs index 547f7440..e3bb437c 100644 --- a/src/layer.rs +++ b/src/layer.rs @@ -32,7 +32,7 @@ pub struct LayerSet { layers: Vec, } -#[allow(clippy::clippy::len_without_is_empty)] // never empty +#[allow(clippy::len_without_is_empty)] // never empty impl LayerSet { /// Load the layers from the provided path. /// @@ -79,6 +79,7 @@ impl LayerSet { /// The number of layers in the set. /// /// This should be non-zero. + #[allow(clippy::len_without_is_empty)] pub fn len(&self) -> usize { self.layers.len() } diff --git a/src/lib.rs b/src/lib.rs index c975e6d9..80314e37 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,6 +22,7 @@ extern crate serde_derive; extern crate serde_repr; pub mod error; +mod font; pub mod fontinfo; mod glyph; mod guideline; @@ -29,11 +30,11 @@ mod identifier; mod layer; mod names; mod shared_types; -mod ufo; mod upconversion; pub mod util; pub use error::Error; +pub use font::{DataRequest, Font, FormatVersion, MetaInfo}; pub use fontinfo::FontInfo; pub use glyph::{ AffineTransform, Anchor, Component, Contour, ContourPoint, GlifVersion, Glyph, GlyphName, @@ -43,7 +44,6 @@ pub use guideline::{Guideline, Line}; pub use identifier::Identifier; pub use layer::{Layer, LayerSet}; pub use shared_types::{Color, IntegerOrFloat, NonNegativeIntegerOrFloat, Plist}; -pub use ufo::{DataRequest, Font, FormatVersion, MetaInfo}; #[allow(deprecated)] -pub use ufo::Ufo; +pub use font::Ufo; diff --git a/src/upconversion.rs b/src/upconversion.rs index 0c551727..1a76ea42 100644 --- a/src/upconversion.rs +++ b/src/upconversion.rs @@ -1,10 +1,10 @@ use std::collections::{BTreeMap, HashMap, HashSet}; use std::path::Path; +use crate::font::{Groups, Kerning}; use crate::fontinfo::FontInfo; use crate::names::NameList; use crate::shared_types::IntegerOrFloat; -use crate::ufo::{Groups, Kerning}; use crate::Error; /// Convert kerning groups and pairs from v1 and v2 informal conventions to @@ -216,8 +216,8 @@ mod tests { extern crate maplit; use super::*; + use crate::font::{Font, FormatVersion}; use crate::glyph::GlyphName; - use crate::ufo::{Font, FormatVersion}; use maplit::btreemap; #[test]