We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e96167f commit 53f57fdCopy full SHA for 53f57fd
src/types.rs
@@ -382,6 +382,21 @@ impl Waypoint {
382
self.point.0 //.0 to extract the geo_types::Point from the tuple struct GpxPoint
383
}
384
385
+ /// Returns a mutable reference to the point of the waypoint.
386
+ ///
387
+ /// ```
388
+ /// use gpx::Waypoint;
389
+ /// use geo_types::Point;
390
391
+ /// let mut wpt = Waypoint::new(Point::new(-121.97, 37.24));
392
+ /// wpt.point_mut().set_x(100.34);
393
+ /// assert_eq!(wpt.point().x(), 100.34);
394
+ /// assert_eq!(wpt.point().y(), 37.24);
395
396
+ pub fn point_mut(&mut self) -> &mut Point<f64> {
397
+ &mut self.point.0
398
+ }
399
+
400
/// Creates a new Waypoint from a given geographical point.
401
///
402
/// ```
0 commit comments