diff --git a/Cargo.toml b/Cargo.toml index cb41bad7..cbf12dc9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] members = [ - "algo/*", + "libs/*", "tool/oj_test", "tool/oj_test_examples/*", "tool/bundle", diff --git a/algo/arithmetic_series/Cargo.toml b/libs/arithmetic_series/Cargo.toml similarity index 100% rename from algo/arithmetic_series/Cargo.toml rename to libs/arithmetic_series/Cargo.toml diff --git a/algo/arithmetic_series/src/lib.rs b/libs/arithmetic_series/src/lib.rs similarity index 100% rename from algo/arithmetic_series/src/lib.rs rename to libs/arithmetic_series/src/lib.rs diff --git a/algo/auxiliary_tree/Cargo.toml b/libs/auxiliary_tree/Cargo.toml similarity index 100% rename from algo/auxiliary_tree/Cargo.toml rename to libs/auxiliary_tree/Cargo.toml diff --git a/algo/auxiliary_tree/examples/aoj_0439.rs b/libs/auxiliary_tree/examples/aoj_0439.rs similarity index 100% rename from algo/auxiliary_tree/examples/aoj_0439.rs rename to libs/auxiliary_tree/examples/aoj_0439.rs diff --git a/algo/auxiliary_tree/src/lib.rs b/libs/auxiliary_tree/src/lib.rs similarity index 100% rename from algo/auxiliary_tree/src/lib.rs rename to libs/auxiliary_tree/src/lib.rs diff --git a/algo/avl_tree/Cargo.toml b/libs/avl_tree/Cargo.toml similarity index 100% rename from algo/avl_tree/Cargo.toml rename to libs/avl_tree/Cargo.toml diff --git a/algo/avl_tree/examples/avl_ordered_set.rs b/libs/avl_tree/examples/avl_ordered_set.rs similarity index 100% rename from algo/avl_tree/examples/avl_ordered_set.rs rename to libs/avl_tree/examples/avl_ordered_set.rs diff --git a/algo/avl_tree/src/lib.rs b/libs/avl_tree/src/lib.rs similarity index 100% rename from algo/avl_tree/src/lib.rs rename to libs/avl_tree/src/lib.rs diff --git a/algo/binary_search_range/Cargo.toml b/libs/binary_search_range/Cargo.toml similarity index 100% rename from algo/binary_search_range/Cargo.toml rename to libs/binary_search_range/Cargo.toml diff --git a/algo/binary_search_range/src/lib.rs b/libs/binary_search_range/src/lib.rs similarity index 100% rename from algo/binary_search_range/src/lib.rs rename to libs/binary_search_range/src/lib.rs diff --git a/algo/cumulative_sum_2d/Cargo.toml b/libs/cumulative_sum_2d/Cargo.toml similarity index 100% rename from algo/cumulative_sum_2d/Cargo.toml rename to libs/cumulative_sum_2d/Cargo.toml diff --git a/algo/cumulative_sum_2d/src/lib.rs b/libs/cumulative_sum_2d/src/lib.rs similarity index 100% rename from algo/cumulative_sum_2d/src/lib.rs rename to libs/cumulative_sum_2d/src/lib.rs diff --git a/algo/detect_cycle/Cargo.toml b/libs/detect_cycle/Cargo.toml similarity index 100% rename from algo/detect_cycle/Cargo.toml rename to libs/detect_cycle/Cargo.toml diff --git a/algo/detect_cycle/examples/cycle_detection.rs b/libs/detect_cycle/examples/cycle_detection.rs similarity index 100% rename from algo/detect_cycle/examples/cycle_detection.rs rename to libs/detect_cycle/examples/cycle_detection.rs diff --git a/algo/detect_cycle/examples/judge_cycle_detection.rs b/libs/detect_cycle/examples/judge_cycle_detection.rs similarity index 100% rename from algo/detect_cycle/examples/judge_cycle_detection.rs rename to libs/detect_cycle/examples/judge_cycle_detection.rs diff --git a/algo/detect_cycle/src/lib.rs b/libs/detect_cycle/src/lib.rs similarity index 100% rename from algo/detect_cycle/src/lib.rs rename to libs/detect_cycle/src/lib.rs diff --git a/algo/dijkstra/Cargo.toml b/libs/dijkstra/Cargo.toml similarity index 100% rename from algo/dijkstra/Cargo.toml rename to libs/dijkstra/Cargo.toml diff --git a/algo/dijkstra/examples/judge_shortest_path.rs b/libs/dijkstra/examples/judge_shortest_path.rs similarity index 100% rename from algo/dijkstra/examples/judge_shortest_path.rs rename to libs/dijkstra/examples/judge_shortest_path.rs diff --git a/algo/dijkstra/examples/shortest_path.rs b/libs/dijkstra/examples/shortest_path.rs similarity index 100% rename from algo/dijkstra/examples/shortest_path.rs rename to libs/dijkstra/examples/shortest_path.rs diff --git a/algo/dijkstra/src/lib.rs b/libs/dijkstra/src/lib.rs similarity index 100% rename from algo/dijkstra/src/lib.rs rename to libs/dijkstra/src/lib.rs diff --git a/algo/divisors/Cargo.toml b/libs/divisors/Cargo.toml similarity index 100% rename from algo/divisors/Cargo.toml rename to libs/divisors/Cargo.toml diff --git a/algo/divisors/src/lib.rs b/libs/divisors/src/lib.rs similarity index 100% rename from algo/divisors/src/lib.rs rename to libs/divisors/src/lib.rs diff --git a/algo/ext_gcd/Cargo.toml b/libs/ext_gcd/Cargo.toml similarity index 100% rename from algo/ext_gcd/Cargo.toml rename to libs/ext_gcd/Cargo.toml diff --git a/algo/ext_gcd/src/lib.rs b/libs/ext_gcd/src/lib.rs similarity index 100% rename from algo/ext_gcd/src/lib.rs rename to libs/ext_gcd/src/lib.rs diff --git a/algo/factorials/Cargo.toml b/libs/factorials/Cargo.toml similarity index 100% rename from algo/factorials/Cargo.toml rename to libs/factorials/Cargo.toml diff --git a/algo/factorials/src/lib.rs b/libs/factorials/src/lib.rs similarity index 100% rename from algo/factorials/src/lib.rs rename to libs/factorials/src/lib.rs diff --git a/algo/fenwick_tree/Cargo.toml b/libs/fenwick_tree/Cargo.toml similarity index 100% rename from algo/fenwick_tree/Cargo.toml rename to libs/fenwick_tree/Cargo.toml diff --git a/algo/fenwick_tree/examples/point_add_range_sum.rs b/libs/fenwick_tree/examples/point_add_range_sum.rs similarity index 100% rename from algo/fenwick_tree/examples/point_add_range_sum.rs rename to libs/fenwick_tree/examples/point_add_range_sum.rs diff --git a/algo/fenwick_tree/src/lib.rs b/libs/fenwick_tree/src/lib.rs similarity index 100% rename from algo/fenwick_tree/src/lib.rs rename to libs/fenwick_tree/src/lib.rs diff --git a/algo/floor_sqrt/Cargo.toml b/libs/floor_sqrt/Cargo.toml similarity index 100% rename from algo/floor_sqrt/Cargo.toml rename to libs/floor_sqrt/Cargo.toml diff --git a/algo/floor_sqrt/src/lib.rs b/libs/floor_sqrt/src/lib.rs similarity index 100% rename from algo/floor_sqrt/src/lib.rs rename to libs/floor_sqrt/src/lib.rs diff --git a/algo/graph/Cargo.toml b/libs/graph/Cargo.toml similarity index 100% rename from algo/graph/Cargo.toml rename to libs/graph/Cargo.toml diff --git a/algo/graph/src/lib.rs b/libs/graph/src/lib.rs similarity index 100% rename from algo/graph/src/lib.rs rename to libs/graph/src/lib.rs diff --git a/algo/grid_search/Cargo.toml b/libs/grid_search/Cargo.toml similarity index 100% rename from algo/grid_search/Cargo.toml rename to libs/grid_search/Cargo.toml diff --git a/algo/grid_search/src/lib.rs b/libs/grid_search/src/lib.rs similarity index 100% rename from algo/grid_search/src/lib.rs rename to libs/grid_search/src/lib.rs diff --git a/algo/least_prime_factors/Cargo.toml b/libs/least_prime_factors/Cargo.toml similarity index 100% rename from algo/least_prime_factors/Cargo.toml rename to libs/least_prime_factors/Cargo.toml diff --git a/algo/least_prime_factors/src/lib.rs b/libs/least_prime_factors/src/lib.rs similarity index 100% rename from algo/least_prime_factors/src/lib.rs rename to libs/least_prime_factors/src/lib.rs diff --git a/algo/lowest_common_ancestor/Cargo.toml b/libs/lowest_common_ancestor/Cargo.toml similarity index 100% rename from algo/lowest_common_ancestor/Cargo.toml rename to libs/lowest_common_ancestor/Cargo.toml diff --git a/algo/lowest_common_ancestor/examples/lca.rs b/libs/lowest_common_ancestor/examples/lca.rs similarity index 100% rename from algo/lowest_common_ancestor/examples/lca.rs rename to libs/lowest_common_ancestor/examples/lca.rs diff --git a/algo/lowest_common_ancestor/src/lib.rs b/libs/lowest_common_ancestor/src/lib.rs similarity index 100% rename from algo/lowest_common_ancestor/src/lib.rs rename to libs/lowest_common_ancestor/src/lib.rs diff --git a/algo/mod_int/Cargo.toml b/libs/mod_int/Cargo.toml similarity index 87% rename from algo/mod_int/Cargo.toml rename to libs/mod_int/Cargo.toml index ad20d40e..731ed0dd 100644 --- a/algo/mod_int/Cargo.toml +++ b/libs/mod_int/Cargo.toml @@ -8,7 +8,7 @@ license = "CC0-1.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -ext_gcd = { path = "../../algo/ext_gcd" } +ext_gcd = { path = "../ext_gcd" } [dev-dependencies] rand = "0.7" diff --git a/algo/mod_int/src/lib.rs b/libs/mod_int/src/lib.rs similarity index 100% rename from algo/mod_int/src/lib.rs rename to libs/mod_int/src/lib.rs diff --git a/algo/next_permutation/Cargo.toml b/libs/next_permutation/Cargo.toml similarity index 100% rename from algo/next_permutation/Cargo.toml rename to libs/next_permutation/Cargo.toml diff --git a/algo/next_permutation/src/lib.rs b/libs/next_permutation/src/lib.rs similarity index 100% rename from algo/next_permutation/src/lib.rs rename to libs/next_permutation/src/lib.rs diff --git a/algo/pascal_triangle/Cargo.toml b/libs/pascal_triangle/Cargo.toml similarity index 100% rename from algo/pascal_triangle/Cargo.toml rename to libs/pascal_triangle/Cargo.toml diff --git a/algo/pascal_triangle/src/lib.rs b/libs/pascal_triangle/src/lib.rs similarity index 100% rename from algo/pascal_triangle/src/lib.rs rename to libs/pascal_triangle/src/lib.rs diff --git a/algo/prime_factorization/Cargo.toml b/libs/prime_factorization/Cargo.toml similarity index 100% rename from algo/prime_factorization/Cargo.toml rename to libs/prime_factorization/Cargo.toml diff --git a/algo/prime_factorization/src/lib.rs b/libs/prime_factorization/src/lib.rs similarity index 100% rename from algo/prime_factorization/src/lib.rs rename to libs/prime_factorization/src/lib.rs diff --git a/algo/re_rooting_dp/Cargo.toml b/libs/re_rooting_dp/Cargo.toml similarity index 100% rename from algo/re_rooting_dp/Cargo.toml rename to libs/re_rooting_dp/Cargo.toml diff --git a/algo/re_rooting_dp/examples/tree_path_composite_sum.rs b/libs/re_rooting_dp/examples/tree_path_composite_sum.rs similarity index 100% rename from algo/re_rooting_dp/examples/tree_path_composite_sum.rs rename to libs/re_rooting_dp/examples/tree_path_composite_sum.rs diff --git a/algo/re_rooting_dp/src/lib.rs b/libs/re_rooting_dp/src/lib.rs similarity index 100% rename from algo/re_rooting_dp/src/lib.rs rename to libs/re_rooting_dp/src/lib.rs diff --git a/algo/rolling_hash/Cargo.toml b/libs/rolling_hash/Cargo.toml similarity index 100% rename from algo/rolling_hash/Cargo.toml rename to libs/rolling_hash/Cargo.toml diff --git a/algo/rolling_hash/src/lib.rs b/libs/rolling_hash/src/lib.rs similarity index 100% rename from algo/rolling_hash/src/lib.rs rename to libs/rolling_hash/src/lib.rs diff --git a/algo/run_length/Cargo.toml b/libs/run_length/Cargo.toml similarity index 100% rename from algo/run_length/Cargo.toml rename to libs/run_length/Cargo.toml diff --git a/algo/run_length/src/lib.rs b/libs/run_length/src/lib.rs similarity index 100% rename from algo/run_length/src/lib.rs rename to libs/run_length/src/lib.rs diff --git a/algo/segment_tree/Cargo.toml b/libs/segment_tree/Cargo.toml similarity index 100% rename from algo/segment_tree/Cargo.toml rename to libs/segment_tree/Cargo.toml diff --git a/algo/segment_tree/examples/point_set_range_composite.rs b/libs/segment_tree/examples/point_set_range_composite.rs similarity index 100% rename from algo/segment_tree/examples/point_set_range_composite.rs rename to libs/segment_tree/examples/point_set_range_composite.rs diff --git a/algo/segment_tree/src/lib.rs b/libs/segment_tree/src/lib.rs similarity index 100% rename from algo/segment_tree/src/lib.rs rename to libs/segment_tree/src/lib.rs diff --git a/algo/sliding_window/Cargo.toml b/libs/sliding_window/Cargo.toml similarity index 100% rename from algo/sliding_window/Cargo.toml rename to libs/sliding_window/Cargo.toml diff --git a/algo/sliding_window/src/lib.rs b/libs/sliding_window/src/lib.rs similarity index 100% rename from algo/sliding_window/src/lib.rs rename to libs/sliding_window/src/lib.rs diff --git a/algo/strongly_connected_components/Cargo.toml b/libs/strongly_connected_components/Cargo.toml similarity index 100% rename from algo/strongly_connected_components/Cargo.toml rename to libs/strongly_connected_components/Cargo.toml diff --git a/algo/strongly_connected_components/examples/judge_scc.rs b/libs/strongly_connected_components/examples/judge_scc.rs similarity index 100% rename from algo/strongly_connected_components/examples/judge_scc.rs rename to libs/strongly_connected_components/examples/judge_scc.rs diff --git a/algo/strongly_connected_components/examples/scc.rs b/libs/strongly_connected_components/examples/scc.rs similarity index 100% rename from algo/strongly_connected_components/examples/scc.rs rename to libs/strongly_connected_components/examples/scc.rs diff --git a/algo/strongly_connected_components/src/lib.rs b/libs/strongly_connected_components/src/lib.rs similarity index 100% rename from algo/strongly_connected_components/src/lib.rs rename to libs/strongly_connected_components/src/lib.rs diff --git a/algo/suffix_array/Cargo.toml b/libs/suffix_array/Cargo.toml similarity index 100% rename from algo/suffix_array/Cargo.toml rename to libs/suffix_array/Cargo.toml diff --git a/algo/suffix_array/examples/number_of_substrings.rs b/libs/suffix_array/examples/number_of_substrings.rs similarity index 100% rename from algo/suffix_array/examples/number_of_substrings.rs rename to libs/suffix_array/examples/number_of_substrings.rs diff --git a/algo/suffix_array/examples/suffixarray.rs b/libs/suffix_array/examples/suffixarray.rs similarity index 100% rename from algo/suffix_array/examples/suffixarray.rs rename to libs/suffix_array/examples/suffixarray.rs diff --git a/algo/suffix_array/src/lib.rs b/libs/suffix_array/src/lib.rs similarity index 100% rename from algo/suffix_array/src/lib.rs rename to libs/suffix_array/src/lib.rs diff --git a/algo/topological_sort/Cargo.toml b/libs/topological_sort/Cargo.toml similarity index 100% rename from algo/topological_sort/Cargo.toml rename to libs/topological_sort/Cargo.toml diff --git a/algo/topological_sort/src/lib.rs b/libs/topological_sort/src/lib.rs similarity index 100% rename from algo/topological_sort/src/lib.rs rename to libs/topological_sort/src/lib.rs diff --git a/algo/treap/Cargo.toml b/libs/treap/Cargo.toml similarity index 100% rename from algo/treap/Cargo.toml rename to libs/treap/Cargo.toml diff --git a/algo/treap/examples/treap_ordered_set.rs b/libs/treap/examples/treap_ordered_set.rs similarity index 100% rename from algo/treap/examples/treap_ordered_set.rs rename to libs/treap/examples/treap_ordered_set.rs diff --git a/algo/treap/src/lib.rs b/libs/treap/src/lib.rs similarity index 100% rename from algo/treap/src/lib.rs rename to libs/treap/src/lib.rs diff --git a/algo/tree_diameter/Cargo.toml b/libs/tree_diameter/Cargo.toml similarity index 100% rename from algo/tree_diameter/Cargo.toml rename to libs/tree_diameter/Cargo.toml diff --git a/algo/tree_diameter/examples/tree_diameter.rs b/libs/tree_diameter/examples/tree_diameter.rs similarity index 100% rename from algo/tree_diameter/examples/tree_diameter.rs rename to libs/tree_diameter/examples/tree_diameter.rs diff --git a/algo/tree_diameter/src/lib.rs b/libs/tree_diameter/src/lib.rs similarity index 100% rename from algo/tree_diameter/src/lib.rs rename to libs/tree_diameter/src/lib.rs diff --git a/algo/union_find/Cargo.toml b/libs/union_find/Cargo.toml similarity index 100% rename from algo/union_find/Cargo.toml rename to libs/union_find/Cargo.toml diff --git a/algo/union_find/examples/unionfind.rs b/libs/union_find/examples/unionfind.rs similarity index 100% rename from algo/union_find/examples/unionfind.rs rename to libs/union_find/examples/unionfind.rs diff --git a/algo/union_find/src/lib.rs b/libs/union_find/src/lib.rs similarity index 100% rename from algo/union_find/src/lib.rs rename to libs/union_find/src/lib.rs diff --git a/algo/z_algorithm/Cargo.toml b/libs/z_algorithm/Cargo.toml similarity index 100% rename from algo/z_algorithm/Cargo.toml rename to libs/z_algorithm/Cargo.toml diff --git a/algo/z_algorithm/examples/zalgorithm.rs b/libs/z_algorithm/examples/zalgorithm.rs similarity index 100% rename from algo/z_algorithm/examples/zalgorithm.rs rename to libs/z_algorithm/examples/zalgorithm.rs diff --git a/algo/z_algorithm/src/lib.rs b/libs/z_algorithm/src/lib.rs similarity index 100% rename from algo/z_algorithm/src/lib.rs rename to libs/z_algorithm/src/lib.rs diff --git a/algo/zarts/Cargo.toml b/libs/zarts/Cargo.toml similarity index 100% rename from algo/zarts/Cargo.toml rename to libs/zarts/Cargo.toml diff --git a/algo/zarts/src/lib.rs b/libs/zarts/src/lib.rs similarity index 100% rename from algo/zarts/src/lib.rs rename to libs/zarts/src/lib.rs diff --git a/tool/bundle/src/main.rs b/tool/bundle/src/main.rs index 9e04f64a..2769411e 100644 --- a/tool/bundle/src/main.rs +++ b/tool/bundle/src/main.rs @@ -116,10 +116,10 @@ struct CrateInfo { } fn bundle_crate(crate_name: &str, workspace_path: &Path) -> Result { - let algo_path = workspace_path.join("algo"); + let libs_path = workspace_path.join("libs"); let mut crates = HashMap::new(); - collect_crates(&algo_path, &mut crates)?; + collect_crates(&libs_path, &mut crates)?; let target_crate_info = crates .get(crate_name) @@ -170,8 +170,8 @@ fn bundle_crate(crate_name: &str, workspace_path: &Path) -> Result { Ok(bundled_code) } -fn collect_crates(algo_path: &Path, crates: &mut HashMap) -> Result<()> { - for entry in fs::read_dir(algo_path)? { +fn collect_crates(libs_path: &Path, crates: &mut HashMap) -> Result<()> { + for entry in fs::read_dir(libs_path)? { let entry = entry?; if entry.file_type()?.is_dir() { let crate_path = entry.path();