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:
@@ -20,6 +20,7 @@ pub enum ExportEvent {
|
|||||||
Finished {
|
Finished {
|
||||||
paths: Vec<String>,
|
paths: Vec<String>,
|
||||||
},
|
},
|
||||||
|
#[allow(dead_code)] // Reserved for future error-channel reporting
|
||||||
Error {
|
Error {
|
||||||
message: String,
|
message: String,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ pub enum DownloadEvent {
|
|||||||
Progress { percent: f64 },
|
Progress { percent: f64 },
|
||||||
FilePath { path: String },
|
FilePath { path: String },
|
||||||
Finished { success: bool, path: String },
|
Finished { success: bool, path: String },
|
||||||
|
#[allow(dead_code)] // Reserved for future error-channel reporting
|
||||||
Error { message: String },
|
Error { message: String },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use std::process::{Command, Stdio};
|
|||||||
/// Strip YouTube auto-generated VTT karaoke tags and positioning metadata
|
/// Strip YouTube auto-generated VTT karaoke tags and positioning metadata
|
||||||
/// that confuse ffmpeg's VTT parser / mov_text conversion.
|
/// that confuse ffmpeg's VTT parser / mov_text conversion.
|
||||||
/// Returns the path to a cleaned temp VTT file.
|
/// 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> {
|
pub fn sanitize_vtt_for_ffmpeg(caption_path: &str, temp_dir: &str) -> Result<String, String> {
|
||||||
let content = std::fs::read_to_string(caption_path)
|
let content = std::fs::read_to_string(caption_path)
|
||||||
.map_err(|e| format!("Failed to read VTT file '{}': {e}", 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.
|
/// Convert a background opacity (0.0=transparent, 1.0=opaque) to ASS BackColour.
|
||||||
/// ASS alpha: 00=opaque, FF=transparent (inverted from CSS).
|
/// 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 {
|
fn opacity_to_ass_back_colour(opacity: f64) -> String {
|
||||||
let alpha = ((1.0 - opacity.clamp(0.0, 1.0)) * 255.0).round() as u8;
|
let alpha = ((1.0 - opacity.clamp(0.0, 1.0)) * 255.0).round() as u8;
|
||||||
format!("&H{:02X}000000", alpha)
|
format!("&H{:02X}000000", alpha)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Build an ASS force_style string from user caption settings.
|
/// 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 {
|
fn caption_style_to_force_style(style: &CaptionStyle) -> String {
|
||||||
let font_size = (style.font_size as f64 * 2.0).round() as u32;
|
let font_size = (style.font_size as f64 * 2.0).round() as u32;
|
||||||
let primary_colour = hex_to_ass_color(&style.text_color);
|
let primary_colour = hex_to_ass_color(&style.text_color);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ use std::collections::HashMap;
|
|||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
|
#[allow(dead_code)] // Fields used for serde deserialization
|
||||||
pub struct SubtitleFormat {
|
pub struct SubtitleFormat {
|
||||||
pub ext: Option<String>,
|
pub ext: Option<String>,
|
||||||
pub url: Option<String>,
|
pub url: Option<String>,
|
||||||
|
|||||||
Reference in New Issue
Block a user