Skip to content

Commit

Permalink
Inline more.
Browse files Browse the repository at this point in the history
  • Loading branch information
RazrFalcon committed Oct 30, 2021
1 parent 94aac43 commit ba4fc75
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ggg/chained_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ impl<'a> ChainedContextLookup<'a> {
}

/// Returns the subtable coverage.
#[inline]
pub fn coverage(&self) -> Coverage<'a> {
match self {
Self::Format1 { coverage, .. } => *coverage,
Expand Down
1 change: 1 addition & 0 deletions src/ggg/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ impl<'a> ContextLookup<'a> {
}

/// Returns the subtable coverage.
#[inline]
pub fn coverage(&self) -> Coverage<'a> {
match self {
Self::Format1 { coverage, .. } => *coverage,
Expand Down
1 change: 1 addition & 0 deletions src/ggg/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl core::fmt::Debug for LookupSubtables<'_> {

impl<'a> LookupSubtables<'a> {
/// Returns a number of items in the LookupSubtables.
#[inline]
pub fn len(&self) -> u16 {
self.offsets.len()
}
Expand Down
2 changes: 2 additions & 0 deletions src/tables/cmap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ impl<'a> Subtables<'a> {
}

/// Returns the number
#[inline]
pub fn len(&self) -> u16 {
self.records.len()
}
Expand Down Expand Up @@ -242,6 +243,7 @@ pub struct SubtablesIter<'a> {
impl<'a> Iterator for SubtablesIter<'a> {
type Item = Subtable<'a>;

#[inline]
fn next(&mut self) -> Option<Self::Item> {
if self.index < self.subtables.len() {
self.index += 1;
Expand Down
3 changes: 3 additions & 0 deletions src/tables/gpos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ impl<'a> SingleAdjustment<'a> {
}

/// Returns the subtable coverage.
#[inline]
pub fn coverage(&self) -> Coverage<'a> {
match self {
Self::Format1 { coverage, .. } => *coverage,
Expand Down Expand Up @@ -549,6 +550,7 @@ impl<'a> PairAdjustment<'a> {
}

/// Returns the subtable coverage.
#[inline]
pub fn coverage(&self) -> Coverage<'a> {
match self {
Self::Format1 { coverage, .. } => *coverage,
Expand Down Expand Up @@ -936,6 +938,7 @@ impl<'a> LookupSubtable<'a> for PositioningSubtable<'a> {

impl<'a> PositioningSubtable<'a> {
/// Returns the subtable coverage.
#[inline]
pub fn coverage(&self) -> Coverage<'a> {
match self {
Self::Single(t) => t.coverage(),
Expand Down
3 changes: 3 additions & 0 deletions src/tables/gsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ impl<'a> SingleSubstitution<'a> {
}

/// Returns the subtable coverage.
#[inline]
pub fn coverage(&self) -> Coverage<'a> {
match self {
Self::Format1 { coverage, .. } => *coverage,
Expand Down Expand Up @@ -272,6 +273,7 @@ impl<'a> LookupSubtable<'a> for SubstitutionSubtable<'a> {

impl<'a> SubstitutionSubtable<'a> {
/// Returns the subtable coverage.
#[inline]
pub fn coverage(&self) -> Coverage<'a> {
match self {
Self::Single(t) => t.coverage(),
Expand All @@ -285,6 +287,7 @@ impl<'a> SubstitutionSubtable<'a> {
}

/// Checks that the current subtable is *Reverse Chaining Contextual Single*.
#[inline]
pub fn is_reverse(&self) -> bool {
matches!(self, Self::ReverseChainSingle(_))
}
Expand Down

0 comments on commit ba4fc75

Please sign in to comment.