From 8fbc43a9ef5857f807358da793b4fc9eef103e72 Mon Sep 17 00:00:00 2001 From: RTSDA Date: Sun, 20 Apr 2025 10:08:10 -0400 Subject: [PATCH] Fix ownership issue by making LivestreamArchiver borrow the output path --- src/main.rs | 2 +- src/services/livestream_archiver.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2ad3e8e..c661854 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,7 +25,7 @@ async fn main() -> Result<()> { println!("Watching directory: {}", watch_path.display()); println!("Output directory: {}", output_path.display()); - let archiver = LivestreamArchiver::new(output_path); + let archiver = LivestreamArchiver::new(&output_path); let processed_files = Arc::new(Mutex::new(HashSet::new())); // Process existing files first diff --git a/src/services/livestream_archiver.rs b/src/services/livestream_archiver.rs index 2282112..109611b 100644 --- a/src/services/livestream_archiver.rs +++ b/src/services/livestream_archiver.rs @@ -4,12 +4,12 @@ use chrono::NaiveDateTime; use tokio::process::Command; use tokio::time::Duration; -pub struct LivestreamArchiver { - output_path: PathBuf, +pub struct LivestreamArchiver<'a> { + output_path: &'a PathBuf, } -impl LivestreamArchiver { - pub fn new(output_path: PathBuf) -> Self { +impl<'a> LivestreamArchiver<'a> { + pub fn new(output_path: &'a PathBuf) -> Self { LivestreamArchiver { output_path, }