Skip to content

Instantly share code, notes, and snippets.

@ajuckel ajuckel/gist:7018861
Created Oct 17, 2013

What would you like to do?
Rust sort sample
extern mod std;
fn main() {
let input = io::file_reader(&Path(os::args()[1]));
let output = result::get(&io::file_writer(&Path(os::args()[2]), [io::Append, io::Create]));
let mut lines = result::get(&input).read_lines();
std::sort::quick_sort(lines, |a,b| {
str::le(*a, *b)
for lines.each |l| {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.