Skip to content

Commit

Permalink
Add size_hint for Arbitrary LineString impl
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Feb 25, 2021
1 parent ffa3f05 commit c381187
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions geo-types/src/arbitrary.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::mem;
use crate::{
CoordFloat, Coordinate, Geometry, GeometryCollection, LineString, MultiLineString, MultiPoint,
MultiPolygon, Point, Polygon, Rect, Triangle,
Expand Down Expand Up @@ -27,6 +28,10 @@ impl<'a, T: arbitrary::Arbitrary<'a> + CoordFloat> arbitrary::Arbitrary<'a> for

Ok(LineString(coords))
}

fn size_hint(_depth: usize) -> (usize, Option<usize>) {
(mem::size_of::<T>() * 2, None)
}
}

impl<'a, T: arbitrary::Arbitrary<'a> + CoordFloat> arbitrary::Arbitrary<'a> for Polygon<T> {
Expand Down

0 comments on commit c381187

Please sign in to comment.