refactor: cargo fmt
This commit is contained in:
parent
796ad91016
commit
62f1b27dff
|
@ -15,4 +15,4 @@ impl Algorithm for Bubblesort {
|
|||
}
|
||||
return Ok(vector);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,11 +19,11 @@ impl Algorithm for Mergesort {
|
|||
}
|
||||
let first = match Mergesort::sort(vector) {
|
||||
Ok(v) => v,
|
||||
Err(e) => return Err(e)
|
||||
Err(e) => return Err(e),
|
||||
};
|
||||
second = match Mergesort::sort(second) {
|
||||
Ok(v) => v,
|
||||
Err(e) => return Err(e)
|
||||
Err(e) => return Err(e),
|
||||
};
|
||||
|
||||
let mut result: Vec<i32> = Vec::new();
|
||||
|
@ -57,4 +57,4 @@ impl Algorithm for Mergesort {
|
|||
return Ok(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,4 +4,5 @@ pub trait Algorithm {
|
|||
|
||||
|
||||
pub mod bubblesort;
|
||||
pub mod mergesort;
|
||||
pub mod mergesort;
|
||||
pub mod insertionsort;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
mod algorithms;
|
||||
|
||||
use algorithms::mergesort::Mergesort;
|
||||
use algorithms::insertionsort::Insertionsort;
|
||||
use algorithms::Algorithm;
|
||||
|
||||
fn main() {
|
||||
let unsorted : Vec<i32> = vec![2498,29687,24,5,94545,8,51,152,48,871,5];
|
||||
let sorted = match Mergesort::sort(unsorted) {
|
||||
let unsorted: Vec<i32> = vec![2498, 29687, 24, 5, 94545, 8, 51, 152, 48, 871, 5];
|
||||
let sorted = match Insertionsort::sort(unsorted) {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
println!("Something went wrong! {}", e);
|
||||
|
@ -13,4 +13,4 @@ fn main() {
|
|||
}
|
||||
};
|
||||
println!("{:?}", sorted);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue