Showing posts with label sorting. Show all posts
Showing posts with label sorting. Show all posts

Monday, February 5, 2024

Rust pop-quiz answer: sorting assets by pnl

#Rust pop-quiz answer to the pop-quiz about sorting assets by pnl.




Sorting assets by pnl becomes easy, once that code it broken out into its own reports-module.



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