Skip to content

Commit

Permalink
Added first effort in Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
x10an14 committed Dec 1, 2017
1 parent f1ec8d3 commit 2c42949
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 0 deletions.
103 changes: 103 additions & 0 deletions sorting_algorithms/merge_sort/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions sorting_algorithms/merge_sort/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "rust"
version = "0.1.0"
authors = ["Christian Chavez <[email protected]>"]

[dependencies]
num-integer = "0.1.35"

[dev-dependencies]
proptest = "0.3.1"
23 changes: 23 additions & 0 deletions sorting_algorithms/merge_sort/rust/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

fn merge_sort<T:Clone + Ord>(arg: &[T]) -> ~[T] {
unimplemented!();
}

// TODO: Figure out proptest crate...
// proptest! {
// #[test]
// fn bleh(){
// assert!(true == true);;
// }
// }

fn main() {
println!("Hello, world!");
let mut list = vec![
4,
1,
3,
2,
] as Vec<i32>;
merge_sort(&mut list);
}
22 changes: 22 additions & 0 deletions sorting_algorithms/merge_sort/rust/test/quickcheck.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#![feature(plugin)]
#![plugin(quickcheck_macros)]

#[cfg(test)]
extern crate quickcheck;

// #[cfg(test)]
// mod tests {
// fn reverse<T: Clone>(xs: &[T]) -> Vec<T> {
// let mut rev = vec!();
// for x in xs {
// rev.insert(0, x.clone())
// }
// rev
// }

// #[quickcheck]
// fn double_reversal_is_identity(xs: Vec<isize>) -> bool {
// xs == reverse(&reverse(&xs))
// }
// }

0 comments on commit 2c42949

Please sign in to comment.