re_types/components/
geo_line_string_ext.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::datatypes::DVec2D;

use super::GeoLineString;

// ---

impl GeoLineString {
    /// Create a new line string from a list of positions.
    #[allow(clippy::should_implement_trait)] // vanilla `FromIter` is too limiting in what it can express
    pub fn from_iter(points: impl IntoIterator<Item = impl Into<DVec2D>>) -> Self {
        Self(points.into_iter().map(Into::into).collect())
    }
}