logo
pub trait MapCoordsInplace<T> {
    fn map_coords_inplace(&mut self, func: impl Fn(&(T, T)) -> (T, T) + Copy)
    where
        T: CoordNum
; }
Expand description

Map a function over all the coordinates in an object in place

Required methods

Apply a function to all the coordinates in a geometric object, in place

Examples
use geo::algorithm::map_coords::MapCoordsInplace;
use geo::Point;
use approx::assert_relative_eq;

let mut p = Point::new(10., 20.);
p.map_coords_inplace(|&(x, y)| (x + 1000., y * 2.));

assert_relative_eq!(p, Point::new(1010., 40.), epsilon = 1e-6);

Implementors