From e5d43e0cd4989cbabbf942f9c4bffb00d799b4ed Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Mon, 9 Jan 2023 06:52:37 +0300 Subject: [PATCH] extra test for empty data --- src/ops.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ops.rs b/src/ops.rs index 4ff586a..74472af 100644 --- a/src/ops.rs +++ b/src/ops.rs @@ -124,6 +124,16 @@ impl Sodg { /// ``` /// /// If vertex `v1` is absent, an `Err` will be returned. + /// + /// If there is no data, an empty `Hex` will be returned, for example: + /// + /// ``` + /// use sodg::Hex; + /// use sodg::Sodg; + /// let mut g = Sodg::empty(); + /// g.add(42).unwrap(); + /// assert!(g.data(42).unwrap().is_empty()); + /// ``` pub fn data(&mut self, v: u32) -> Result { let vtx = self .vertices