fix: suppress Rust dead code warnings with annotations

- ExportEvent::Error and DownloadEvent::Error reserved for future use
- clip_exporter functions scaffolded for caption burn-in pipeline
- SubtitleFormat fields required for serde deserialization

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-22 13:32:23 -04:00
parent 9d1f1cfcf3
commit d85fbdac05
4 changed files with 6 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ use std::process::{Command, Stdio};
/// Strip YouTube auto-generated VTT karaoke tags and positioning metadata
/// that confuse ffmpeg's VTT parser / mov_text conversion.
/// Returns the path to a cleaned temp VTT file.
#[allow(dead_code)] // Scaffolded for caption burn-in pipeline
pub fn sanitize_vtt_for_ffmpeg(caption_path: &str, temp_dir: &str) -> Result<String, String> {
let content = std::fs::read_to_string(caption_path)
.map_err(|e| format!("Failed to read VTT file '{}': {e}", caption_path))?;
@@ -201,12 +202,14 @@ fn hex_to_ass_color(hex: &str) -> String {
/// Convert a background opacity (0.0=transparent, 1.0=opaque) to ASS BackColour.
/// ASS alpha: 00=opaque, FF=transparent (inverted from CSS).
#[allow(dead_code)] // Scaffolded for caption burn-in pipeline
fn opacity_to_ass_back_colour(opacity: f64) -> String {
let alpha = ((1.0 - opacity.clamp(0.0, 1.0)) * 255.0).round() as u8;
format!("&H{:02X}000000", alpha)
}
/// Build an ASS force_style string from user caption settings.
#[allow(dead_code)] // Scaffolded for caption burn-in pipeline
fn caption_style_to_force_style(style: &CaptionStyle) -> String {
let font_size = (style.font_size as f64 * 2.0).round() as u32;
let primary_colour = hex_to_ass_color(&style.text_color);