1
0

Move code into library crate for testing

This commit is contained in:
Stefan Müller
2025-12-08 18:20:41 +01:00
parent fd488ac8e4
commit aac486d69f
4 changed files with 8 additions and 3 deletions
+3
View File
@@ -3,6 +3,9 @@
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/lib/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/src/lib/target" />
<excludeFolder url="file://$MODULE_DIR$/target" /> <excludeFolder url="file://$MODULE_DIR$/target" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
+2
View File
@@ -0,0 +1,2 @@
mod common;
pub mod solvers;
+1 -2
View File
@@ -1,5 +1,4 @@
mod common; use advent_of_code_2025::solvers;
mod solvers;
fn main() { fn main() {
println!("### Advent of Code 2025 ###\n"); println!("### Advent of Code 2025 ###\n");
+2 -1
View File
@@ -25,7 +25,8 @@ pub trait Solver {
// The "../../data" and "../../../data" paths are useful for running the binary from // The "../../data" and "../../../data" paths are useful for running the binary from
// "target/release/" directory with "data/" directory in package root or parent directory. // "target/release/" directory with "data/" directory in package root or parent directory.
const DATA_PATHS: &'static [&'static str] = &["./data", "../data", "../../data", "../../../data"]; pub const DATA_PATHS: &'static [&'static str] =
&["./data", "../data", "../../data", "../../../data"];
pub fn run<S: Solver>(solver: S) { pub fn run<S: Solver>(solver: S) {
println!( println!(