From 9d86f663ed93b04dbeb2d38ada706840a0bd7d27 Mon Sep 17 00:00:00 2001 From: Sebastian K Date: Wed, 24 Jun 2020 17:47:30 -0700 Subject: [PATCH] Add a new `Outline::len()` method --- content/src/outline.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/src/outline.rs b/content/src/outline.rs index 5223682c..b8aed554 100644 --- a/content/src/outline.rs +++ b/content/src/outline.rs @@ -238,6 +238,12 @@ impl Outline { self.contours.iter().all(Contour::is_empty) } + /// Returns the number of contours in this outline. + #[inline] + pub fn len(&self) -> usize { + self.contours.len() + } + /// Appends the contours in another outline to this one. pub fn push_outline(&mut self, other: Outline) { if other.is_empty() {