Make run a method on Parallax
Assisted-by: GLM-5.3 via pi
change xzrwvxzpkyymvmpmowuktmzwwrokysll
commit 857b2856163b5e1f0fc39556f3063d9e58a787c8
author Alpha Chen <alpha@kejadlen.dev>
date
parent rpurmpxv
diff --git a/src/bin/parallax/main.rs b/src/bin/parallax/main.rs
index c3b3904..dcffef7 100644
--- a/src/bin/parallax/main.rs
+++ b/src/bin/parallax/main.rs
@@ -69,8 +69,12 @@ async fn main() -> miette::Result<()> {
     let parallax = Parallax::load(&cli.config)?;
 
     match command {
-        Commands::Run { output } => parallax::run(&parallax, output.as_deref()).await?,
-        Commands::List => parallax::list(&parallax)?,
+        Commands::Run { output } => parallax.run(output.as_deref()).await?,
+        Commands::List => {
+            for name in parallax.flow_names() {
+                println!("{name}");
+            }
+        }
     }
     Ok(())
 }
diff --git a/src/lib.rs b/src/lib.rs
index 5c7c7a7..9311129 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,9 +1,6 @@
 mod error;
 mod parallax;
-mod run;
 mod validate;
 
 pub use error::Error;
 pub use parallax::Parallax;
-pub use run::list;
-pub use run::run;
diff --git a/src/parallax.rs b/src/parallax.rs
index 6359790..4fd5bdf 100644
--- a/src/parallax.rs
+++ b/src/parallax.rs
@@ -63,6 +63,11 @@ impl Parallax {
     pub fn name(&self) -> &str {
         &self.name
     }
+
+    /// Runs every flow in every viewport.
+    pub async fn run(&self, _output: Option<&Path>) -> Result<(), Error> {
+        Err(Error::NotImplemented)
+    }
 }
 
 /// Parses the validated table into the typed fields and extracts the
diff --git a/src/run.rs b/src/run.rs
deleted file mode 100644
index 970a73a..0000000
--- a/src/run.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-use std::path::Path;
-
-use crate::Error;
-use crate::Parallax;
-
-pub fn list(parallax: &Parallax) -> Result<(), Error> {
-    for name in parallax.flow_names() {
-        println!("{name}");
-    }
-    Ok(())
-}
-
-pub async fn run(_parallax: &Parallax, _output: Option<&Path>) -> Result<(), Error> {
-    Err(Error::NotImplemented)
-}