【发布时间】:2016-06-30 02:38:50
【问题描述】:
我有一个这样的结构
struct Point {
pub x: i32,
pub y: i32,
}
impl Point {
fn new(x: i32, y: i32) -> Self {
Point { x, y }
}
}
还有这样的数组
[Point::new(1, 1), Point::new(4, 2), Point::new(2, 9)];
如何从这个数组中拉出point.x 最大的项目?
【问题讨论】:
标签: rust