use sorting::Algorithm; pub struct Sort; impl Algorithm for Sort { fn sort(mut vector: Vec) -> Result, &'static str> { for i in 0..(vector.len()) { for j in 0..(vector.len() - i - 1) { if vector[j] > vector[j + 1] { let tmp = vector[j]; vector[j] = vector[j + 1]; vector[j + 1] = tmp; } } } return Ok(vector); } }