diff --git a/crates/re_space_view_spatial/src/visualizers/arrows2d.rs b/crates/re_space_view_spatial/src/visualizers/arrows2d.rs index a92603460a85a..4f5792346a3ba 100644 --- a/crates/re_space_view_spatial/src/visualizers/arrows2d.rs +++ b/crates/re_space_view_spatial/src/visualizers/arrows2d.rs @@ -225,8 +225,7 @@ impl VisualizerSystem for Arrows2DVisualizer { let resolver = ctx.recording().resolver(); let vectors = match results.get_dense::(resolver) { - Some(Ok(vectors)) => vectors, - Some(err @ Err(_)) => err?, + Some(vectors) => vectors?, _ => return Ok(()), }; diff --git a/crates/re_space_view_spatial/src/visualizers/arrows3d.rs b/crates/re_space_view_spatial/src/visualizers/arrows3d.rs index 4c811226cfd2d..e5e61d400514d 100644 --- a/crates/re_space_view_spatial/src/visualizers/arrows3d.rs +++ b/crates/re_space_view_spatial/src/visualizers/arrows3d.rs @@ -228,8 +228,7 @@ impl VisualizerSystem for Arrows3DVisualizer { let resolver = ctx.recording().resolver(); let vectors = match results.get_dense::(resolver) { - Some(Ok(vectors)) => vectors, - Some(err @ Err(_)) => err?, + Some(vectors) => vectors?, _ => return Ok(()), }; diff --git a/crates/re_space_view_spatial/src/visualizers/boxes2d.rs b/crates/re_space_view_spatial/src/visualizers/boxes2d.rs index 0af5c69c51693..a22b9ed8ebf83 100644 --- a/crates/re_space_view_spatial/src/visualizers/boxes2d.rs +++ b/crates/re_space_view_spatial/src/visualizers/boxes2d.rs @@ -221,8 +221,7 @@ impl VisualizerSystem for Boxes2DVisualizer { let resolver = ctx.recording().resolver(); let half_sizes = match results.get_dense::(resolver) { - Some(Ok(vectors)) => vectors, - Some(err @ Err(_)) => err?, + Some(vectors) => vectors?, _ => return Ok(()), }; diff --git a/crates/re_space_view_spatial/src/visualizers/boxes3d.rs b/crates/re_space_view_spatial/src/visualizers/boxes3d.rs index e9f441c7eefe4..9df41ce522073 100644 --- a/crates/re_space_view_spatial/src/visualizers/boxes3d.rs +++ b/crates/re_space_view_spatial/src/visualizers/boxes3d.rs @@ -211,8 +211,7 @@ impl VisualizerSystem for Boxes3DVisualizer { let resolver = ctx.recording().resolver(); let half_sizes = match results.get_dense::(resolver) { - Some(Ok(vectors)) => vectors, - Some(err @ Err(_)) => err?, + Some(vectors) => vectors?, _ => return Ok(()), }; diff --git a/crates/re_space_view_spatial/src/visualizers/lines2d.rs b/crates/re_space_view_spatial/src/visualizers/lines2d.rs index 539db0f26aa94..bca1670ef291c 100644 --- a/crates/re_space_view_spatial/src/visualizers/lines2d.rs +++ b/crates/re_space_view_spatial/src/visualizers/lines2d.rs @@ -210,8 +210,7 @@ impl VisualizerSystem for Lines2DVisualizer { let resolver = ctx.recording().resolver(); let strips = match results.get_dense::(resolver) { - Some(Ok(strips)) => strips, - Some(err @ Err(_)) => err?, + Some(strips) => strips?, _ => return Ok(()), }; diff --git a/crates/re_space_view_spatial/src/visualizers/lines3d.rs b/crates/re_space_view_spatial/src/visualizers/lines3d.rs index ec633399584e9..442c38dd97247 100644 --- a/crates/re_space_view_spatial/src/visualizers/lines3d.rs +++ b/crates/re_space_view_spatial/src/visualizers/lines3d.rs @@ -219,8 +219,7 @@ impl VisualizerSystem for Lines3DVisualizer { let resolver = ctx.recording().resolver(); let strips = match results.get_dense::(resolver) { - Some(Ok(strips)) => strips, - Some(err @ Err(_)) => err?, + Some(strips) => strips?, _ => return Ok(()), }; diff --git a/crates/re_space_view_spatial/src/visualizers/mod.rs b/crates/re_space_view_spatial/src/visualizers/mod.rs index 5ad319d268660..98e205ec4ab7e 100644 --- a/crates/re_space_view_spatial/src/visualizers/mod.rs +++ b/crates/re_space_view_spatial/src/visualizers/mod.rs @@ -130,10 +130,7 @@ pub fn process_color_slice<'a>( } } } else { - let colors = colors - .iter() - .chain(std::iter::repeat(colors.last().unwrap())) - .take(num_instances); + let colors = entity_iterator::clamped(colors, num_instances); match annotation_infos { ResolvedAnnotationInfos::Same(_count, annotation_info) => { re_tracing::profile_scope!("many-colors, same annotation"); @@ -166,11 +163,8 @@ pub fn process_radius_slice( if radii.is_empty() { vec![re_renderer::Size::AUTO; num_instances] } else { - radii - .iter() - .chain(std::iter::repeat(radii.last().unwrap())) + entity_iterator::clamped(radii, num_instances) .map(|radius| process_radius(entity_path, *radius)) - .take(num_instances) .collect() } } @@ -218,10 +212,7 @@ fn process_annotation_and_keypoint_slices( ); }; - let class_ids = class_ids - .iter() - .chain(std::iter::repeat(class_ids.last().unwrap())) - .take(num_instances); + let class_ids = entity_iterator::clamped(class_ids, num_instances); if keypoint_ids.is_empty() { let annotation_info = class_ids @@ -236,10 +227,7 @@ fn process_annotation_and_keypoint_slices( Default::default(), ) } else { - let keypoint_ids = keypoint_ids - .iter() - .chain(std::iter::repeat(keypoint_ids.last().unwrap())) - .take(num_instances); + let keypoint_ids = entity_iterator::clamped(keypoint_ids, num_instances); let annotation_info = itertools::izip!(positions, keypoint_ids, class_ids) .map(|(position, keypoint_id, &class_id)| { let class_description = annotations.resolved_class_description(Some(class_id)); diff --git a/crates/re_space_view_spatial/src/visualizers/points2d.rs b/crates/re_space_view_spatial/src/visualizers/points2d.rs index 2f1923e4189c0..9fe4f1a690397 100644 --- a/crates/re_space_view_spatial/src/visualizers/points2d.rs +++ b/crates/re_space_view_spatial/src/visualizers/points2d.rs @@ -229,8 +229,7 @@ impl VisualizerSystem for Points2DVisualizer { let resolver = ctx.recording().resolver(); let positions = match results.get_dense::(resolver) { - Some(Ok(positions)) => positions, - Some(err @ Err(_)) => err?, + Some(positions) => positions?, _ => return Ok(()), }; diff --git a/crates/re_space_view_spatial/src/visualizers/points3d.rs b/crates/re_space_view_spatial/src/visualizers/points3d.rs index fa40239a27812..a0b62e66b1339 100644 --- a/crates/re_space_view_spatial/src/visualizers/points3d.rs +++ b/crates/re_space_view_spatial/src/visualizers/points3d.rs @@ -220,8 +220,7 @@ impl VisualizerSystem for Points3DVisualizer { let resolver = ctx.recording().resolver(); let positions = match results.get_dense::(resolver) { - Some(Ok(positions)) => positions, - Some(err @ Err(_)) => err?, + Some(positions) => positions?, _ => return Ok(()), };