difftastic doesn't show whitespace or formatting changes
33 karma · joined April 7, 2018
It's interesting to see how different DNS providers cap the maximum TTL.
Google uses 21600s
Quad9 uses 43200s
Cloudflare does not cap at all!
And my personal unbound uses 86400s (which is the default)
And yeah, I meant Ord (and the required other Traits), I edited my post. Thanks for pointing this out.
struct Date {
year: u32,
month: u32,
day: u32,
}
let mut vec: Vec<Date> = Vec::new();
vec.sort_by(|a,b| {
a.year.cmp(&b.year)
.then(a.month.cmp(&b.month))
.then(a.day.cmp(&b.day))
});
Alternatively you can derive PartialEq, PartialOrd, Eq and Ord for your struct, which will produce a lexicographic ordering based on the top-to-bottom declaration order of the struct's members: #[derive(PartialEq, PartialOrd, Eq, Ord)]
struct Date {
year: u32,
month: u32,
day: u32,
}