diff --git a/src/algorithm.rs b/src/algorithm.rs index 0ef1550..41ab457 100644 --- a/src/algorithm.rs +++ b/src/algorithm.rs @@ -1,7 +1,5 @@ -mod lpt; +mod manual_threading; mod rayon; -mod single_thread; -pub use lpt::*; +pub use manual_threading::*; pub use rayon::*; -pub use single_thread::single_thread; diff --git a/src/algorithm/lpt.rs b/src/algorithm/manual_threading.rs similarity index 90% rename from src/algorithm/lpt.rs rename to src/algorithm/manual_threading.rs index 1467e5d..dc8719d 100644 --- a/src/algorithm/lpt.rs +++ b/src/algorithm/manual_threading.rs @@ -13,6 +13,12 @@ pub fn multi_threads(data: &[Task]) { run_multi(data); } +pub fn single_thread(data: &[Task]) { + for task in data { + task.execute(); + } +} + #[inline(always)] fn run_multi(data: Vec) { let data_mt = Arc::new(Mutex::new(data)); diff --git a/src/algorithm/single_thread.rs b/src/algorithm/single_thread.rs deleted file mode 100644 index 1bdbe81..0000000 --- a/src/algorithm/single_thread.rs +++ /dev/null @@ -1,7 +0,0 @@ -use crate::Task; - -pub fn single_thread(data: &[Task]) { - for task in data { - task.execute(); - } -}