Monday, February 20, 2023

Rust pop-quiz: sort and print CSV-output

#Rust pop-quiz

(yes, another one)

You see the CSV-output is not sorted prettily.

Sort the output alphabetically.


#Traits Bonus


Given comparator function, f: F
Sort the iterable container, c

print_sorted(f: F, c: impl IntoIterator
   where F: FnMut(&T, &T) -> Ordering

this will go into io_utils.rs

No comments:

Post a Comment