difftastic doesn't show whitespace or formatting changes
Lol
I quite like this tuple approach. And yeah, I meant Ord (and the required other Traits), I edited my post. Thanks for pointing this out.
For sorting sequential fields you can chain comparisons with .then(): 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)…
Rust has a `usize` which is 32 or 64 bits depending on the platform and also serves as the native index type for arrays and such.
Does it cover the Parker Square?
difftastic doesn't show whitespace or formatting changes
Lol
I quite like this tuple approach. And yeah, I meant Ord (and the required other Traits), I edited my post. Thanks for pointing this out.
For sorting sequential fields you can chain comparisons with .then(): 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)…
Rust has a `usize` which is 32 or 64 bits depending on the platform and also serves as the native index type for arrays and such.
Does it cover the Parker Square?