Skip to content

Commit

Permalink
extra test for empty data
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jan 9, 2023
1 parent a5aa939 commit e5d43e0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Hex> {
let vtx = self
.vertices
Expand Down

0 comments on commit e5d43e0

Please sign in to comment.