Clean up build warnings

This commit is contained in:
Skyler Lehmkuhl
2026-02-14 11:07:32 -05:00
parent 82b58ae0dc
commit 777d3ef6be
38 changed files with 210 additions and 480 deletions
@@ -32,7 +32,7 @@ impl Action for MoveClipInstancesAction {
let mut expanded_moves = self.layer_moves.clone();
let mut already_processed = std::collections::HashSet::new();
for (layer_id, moves) in &self.layer_moves {
for (_layer_id, moves) in &self.layer_moves {
for (instance_id, old_start, new_start) in moves {
// Skip if already processed
if already_processed.contains(instance_id) {
@@ -26,10 +26,10 @@ pub struct PaintBucketAction {
fill_color: ShapeColor,
/// Tolerance for gap bridging (in pixels)
tolerance: f64,
_tolerance: f64,
/// Gap handling mode
gap_mode: GapHandlingMode,
_gap_mode: GapHandlingMode,
/// ID of the created shape (set after execution)
created_shape_id: Option<Uuid>,
@@ -59,8 +59,8 @@ impl PaintBucketAction {
layer_id,
click_point,
fill_color,
tolerance,
gap_mode,
_tolerance: tolerance,
_gap_mode: gap_mode,
created_shape_id: None,
created_shape_instance_id: None,
}
@@ -68,26 +68,6 @@ impl SetInstancePropertiesAction {
}
}
fn get_instance_value(&self, document: &Document, instance_id: &Uuid) -> Option<f64> {
if let Some(layer) = document.get_layer(&self.layer_id) {
if let AnyLayer::Vector(vector_layer) = layer {
if let Some(instance) = vector_layer.get_object(instance_id) {
return Some(match &self.property {
InstancePropertyChange::X(_) => instance.transform.x,
InstancePropertyChange::Y(_) => instance.transform.y,
InstancePropertyChange::Rotation(_) => instance.transform.rotation,
InstancePropertyChange::ScaleX(_) => instance.transform.scale_x,
InstancePropertyChange::ScaleY(_) => instance.transform.scale_y,
InstancePropertyChange::SkewX(_) => instance.transform.skew_x,
InstancePropertyChange::SkewY(_) => instance.transform.skew_y,
InstancePropertyChange::Opacity(_) => instance.opacity,
});
}
}
}
None
}
fn apply_to_instance(&self, document: &mut Document, instance_id: &Uuid, value: f64) {
if let Some(layer) = document.get_layer_mut(&self.layer_id) {
if let AnyLayer::Vector(vector_layer) = layer {
@@ -68,7 +68,7 @@ impl Action for TrimClipInstancesAction {
let mut expanded_trims = self.layer_trims.clone();
let mut already_processed = std::collections::HashSet::new();
for (layer_id, trims) in &self.layer_trims {
for (_layer_id, trims) in &self.layer_trims {
for (instance_id, trim_type, old, new) in trims {
// Skip if already processed
if already_processed.contains(instance_id) {
@@ -189,7 +189,7 @@ impl Action for TrimClipInstancesAction {
match trim_type {
TrimType::TrimLeft => {
if let (Some(old_trim), Some(new_trim), Some(old_timeline), Some(new_timeline)) =
if let (Some(old_trim), Some(new_trim), Some(old_timeline), Some(_new_timeline)) =
(old.trim_value, new.trim_value, old.timeline_start, new.timeline_start)
{
// If extending to the left (new_trim < old_trim)
@@ -365,7 +365,7 @@ impl Action for TrimClipInstancesAction {
.ok_or_else(|| format!("Layer {} not mapped to backend track", layer_id))?;
// Process each clip instance trim
for (instance_id, trim_type, _old, new) in trims {
for (instance_id, _trim_type, _old, _new) in trims {
// Get clip instances from the layer
let clip_instances = match layer {
AnyLayer::Audio(al) => &al.clip_instances,
@@ -229,27 +229,6 @@ pub fn find_closest_approach(
}
}
/// Refine intersection parameters using Newton's method
fn refine_intersection(
curve1: &CubicBez,
curve2: &CubicBez,
mut t1: f64,
mut t2: f64,
) -> (f64, f64) {
// Simple refinement: just find nearest points iteratively
for _ in 0..5 {
let p1 = curve1.eval(t1);
let nearest2 = curve2.nearest(p1, 1e-6);
t2 = nearest2.t;
let p2 = curve2.eval(t2);
let nearest1 = curve1.nearest(p2, 1e-6);
t1 = nearest1.t;
}
(t1.clamp(0.0, 1.0), t2.clamp(0.0, 1.0))
}
/// Refine self-intersection parameters
fn refine_self_intersection(curve: &CubicBez, mut t1: f64, mut t2: f64) -> (f64, f64) {
// Refine by moving parameters closer to where curves actually meet
@@ -189,22 +189,6 @@ impl EffectLayer {
self.clip_instances = new_order;
}
// === MUTATION METHODS (pub(crate) - only accessible to action module) ===
/// Add a clip instance (internal, for actions only)
pub(crate) fn add_clip_instance_internal(&mut self, instance: ClipInstance) -> Uuid {
self.add_clip_instance(instance)
}
/// Remove a clip instance (internal, for actions only)
pub(crate) fn remove_clip_instance_internal(&mut self, id: &Uuid) -> Option<ClipInstance> {
self.remove_clip_instance(id)
}
/// Insert a clip instance at a specific index (internal, for actions only)
pub(crate) fn insert_clip_instance_internal(&mut self, index: usize, instance: ClipInstance) -> Uuid {
self.insert_clip_instance(index, instance)
}
}
#[cfg(test)]
@@ -455,23 +455,23 @@ struct CurveIntersection {
t_on_current: f64,
/// Parameter on other curve
t_on_other: f64,
_t_on_other: f64,
/// ID of the other curve
other_curve_id: usize,
_other_curve_id: usize,
/// Intersection point
point: Point,
/// Whether this is a gap (within tolerance but not exact intersection)
is_gap: bool,
_is_gap: bool,
}
/// Find all intersections on a given curve
fn find_intersections_on_curve(
curve_id: usize,
curves: &[CubicBez],
processed_curves: &HashSet<usize>,
_processed_curves: &HashSet<usize>,
quadtree: &ToleranceQuadtree,
tolerance: f64,
debug_info: &mut WalkDebugInfo,
@@ -489,10 +489,10 @@ fn find_intersections_on_curve(
for int in self_ints {
intersections.push(CurveIntersection {
t_on_current: int.t1,
t_on_other: int.t2.unwrap_or(int.t1),
other_curve_id: curve_id,
_t_on_other: int.t2.unwrap_or(int.t1),
_other_curve_id: curve_id,
point: int.point,
is_gap: false,
_is_gap: false,
});
debug_info.intersections_found += 1;
}
@@ -504,10 +504,10 @@ fn find_intersections_on_curve(
for int in exact_ints {
intersections.push(CurveIntersection {
t_on_current: int.t1,
t_on_other: int.t2.unwrap_or(0.0),
other_curve_id: other_id,
_t_on_other: int.t2.unwrap_or(0.0),
_other_curve_id: other_id,
point: int.point,
is_gap: false,
_is_gap: false,
});
debug_info.intersections_found += 1;
}
@@ -516,10 +516,10 @@ fn find_intersections_on_curve(
if let Some(approach) = find_closest_approach(current_curve, other_curve, tolerance) {
intersections.push(CurveIntersection {
t_on_current: approach.t1,
t_on_other: approach.t2,
other_curve_id: other_id,
_t_on_other: approach.t2,
_other_curve_id: other_id,
point: approach.p1,
is_gap: true,
_is_gap: true,
});
}
}
@@ -478,7 +478,7 @@ fn map_t_to_relative_distances(bez: &[Point; 4], b_parts: usize) -> Vec<f64> {
}
/// Find t value for a given parameter distance
fn find_t(bez: &[Point; 4], param: f64, t_dist_map: &[f64], b_parts: usize) -> f64 {
fn find_t(_bez: &[Point; 4], param: f64, t_dist_map: &[f64], b_parts: usize) -> f64 {
if param < 0.0 {
return 0.0;
}
@@ -122,7 +122,7 @@ impl PlanarGraph {
// Initialize with endpoints for all curves
for (i, curve) in curves.iter().enumerate() {
let mut curve_intersections = vec![
let curve_intersections = vec![
(0.0, curve.p0),
(1.0, curve.p3),
];
@@ -202,7 +202,7 @@ impl PlanarGraph {
/// Build nodes and edges from curves and their intersections
fn build_nodes_and_edges(
curves: &[CubicBez],
_curves: &[CubicBez],
intersections: HashMap<usize, Vec<(f64, Point)>>,
) -> (Vec<GraphNode>, Vec<GraphEdge>) {
let mut nodes = Vec::new();
@@ -459,11 +459,6 @@ impl PlanarGraph {
// Get the end node of this half-edge
let edge = &self.edges[current_edge];
let start_node_this_edge = if current_forward {
edge.start_node
} else {
edge.end_node
};
let end_node = if current_forward {
edge.end_node
} else {
@@ -32,9 +32,9 @@ struct ExtractedSegment {
/// Original curve index
curve_index: usize,
/// Minimum parameter value from boundary points
t_min: f64,
_t_min: f64,
/// Maximum parameter value from boundary points
t_max: f64,
_t_max: f64,
/// The curve segment (trimmed to [t_min, t_max])
segment: CurveSegment,
}
@@ -148,8 +148,8 @@ fn split_segments_at_intersections(segments: Vec<ExtractedSegment>) -> Vec<Extra
result.push(ExtractedSegment {
curve_index: seg.curve_index,
t_min: t_start,
t_max: t_end,
_t_min: t_start,
_t_max: t_end,
segment: subseg,
});
}
@@ -260,8 +260,8 @@ fn extract_segments(
segments.push(ExtractedSegment {
curve_index: curve_idx,
t_min,
t_max,
_t_min: t_min,
_t_max: t_max,
segment,
});
}
@@ -540,7 +540,7 @@ enum ConnectedSegment {
Curve {
segment: CurveSegment,
start: Point,
end: Point,
_end: Point,
},
/// A line segment bridging a gap
Line { start: Point, end: Point },
@@ -550,7 +550,7 @@ enum ConnectedSegment {
fn connect_segments(
extracted: &[ExtractedSegment],
config: &SegmentBuilderConfig,
click_point: Point,
_click_point: Point,
) -> Option<Vec<ConnectedSegment>> {
if extracted.is_empty() {
println!("connect_segments: No segments to connect");
@@ -575,7 +575,7 @@ fn connect_segments(
connected.push(ConnectedSegment::Curve {
segment: current.segment.clone(),
start: current.segment.eval_at(0.0),
end: current_end,
_end: current_end,
});
// Check if we need to connect to the next segment
@@ -794,7 +794,7 @@ mod tests {
// If it found segments, verify they're valid
assert!(!segments.is_empty());
for seg in &segments {
assert!(seg.t_min <= seg.t_max);
assert!(seg._t_min <= seg._t_max);
}
}
// If None, the algorithm couldn't form a cycle - that's okay for this test
@@ -23,12 +23,12 @@ pub struct VideoMetadata {
/// Video decoder with LRU frame caching
pub struct VideoDecoder {
path: String,
width: u32, // Original video width
height: u32, // Original video height
_width: u32, // Original video width
_height: u32, // Original video height
output_width: u32, // Scaled output width
output_height: u32, // Scaled output height
fps: f64,
duration: f64,
_duration: f64,
time_base: f64,
stream_index: usize,
frame_cache: LruCache<i64, Vec<u8>>, // timestamp -> RGBA data
@@ -107,12 +107,12 @@ impl VideoDecoder {
Ok(Self {
path,
width,
height,
_width: width,
_height: height,
output_width,
output_height,
fps,
duration,
_duration: duration,
time_base,
stream_index,
frame_cache: LruCache::new(