Hi, I want to sort tuples vector containing one struct and another option struct. For example,
struct Car {
name: String,
price: f64,
number_plate: u32,
}
struct Van {
name: String,
price: f64,
number_plate: u32,
}
fn main() {
let mut vehicles = vec![
(
Car {
name: "car1".to_string(),
price: 3.0,
number_plate: 23,
},
Some(Van {
name: "van1".to_string(),
price: 1.0,
number_plate: 466,
})
),
(
Car {
name: "car2".to_string(),
price: 2.2,
number_plate: 236,
},
Some(Van {
name: "van2".to_string(),
price: 0.3,
number_plate: 343,
})
)
];
// now how to sort this vehicles tuple by price and number_plate fields??
}