I think the comparing algorithm in https://github.com/rust-lang/rustfmt/blob/master/src/sort.rs is a very useful, is it possible to release it as a standalone crate so that it can be reused by other projects?