diff --git a/crates/viewer/re_renderer/src/importer/stl.rs b/crates/viewer/re_renderer/src/importer/stl.rs index deca0e7a2ebd..51cd42c4f669 100644 --- a/crates/viewer/re_renderer/src/importer/stl.rs +++ b/crates/viewer/re_renderer/src/importer/stl.rs @@ -2,10 +2,7 @@ use itertools::Itertools; use smallvec::smallvec; use tinystl::StlData; -use crate::{ - mesh::{self}, - CpuModel, RenderContext, -}; +use crate::{mesh, CpuModel, RenderContext}; #[derive(thiserror::Error, Debug)] pub enum StlImportError { diff --git a/crates/viewer/re_renderer_examples/framework.rs b/crates/viewer/re_renderer_examples/framework.rs index c0fd2433c92e..751565ad619c 100644 --- a/crates/viewer/re_renderer_examples/framework.rs +++ b/crates/viewer/re_renderer_examples/framework.rs @@ -326,16 +326,18 @@ impl Application { } #[allow(dead_code)] -pub fn load_rerun_mesh(re_ctx: &RenderContext) -> Vec { +pub fn load_rerun_mesh( + re_ctx: &RenderContext, +) -> anyhow::Result> { let reader = std::io::Cursor::new(include_bytes!("../../../tests/assets/rerun.obj.zip")); - let mut zip = zip::ZipArchive::new(reader).unwrap(); - let mut zipped_obj = zip.by_name("rerun.obj").unwrap(); + let mut zip = zip::ZipArchive::new(reader)?; + let mut zipped_obj = zip.by_name("rerun.obj")?; let mut obj_data = Vec::new(); - std::io::Read::read_to_end(&mut zipped_obj, &mut obj_data).unwrap(); - re_renderer::importer::obj::load_obj_from_buffer(&obj_data, re_ctx) - .unwrap() - .into_gpu_meshes(re_ctx) - .unwrap() + std::io::Read::read_to_end(&mut zipped_obj, &mut obj_data)?; + Ok( + re_renderer::importer::obj::load_obj_from_buffer(&obj_data, re_ctx)? + .into_gpu_meshes(re_ctx)?, + ) } struct WrapApp { diff --git a/crates/viewer/re_renderer_examples/multiview.rs b/crates/viewer/re_renderer_examples/multiview.rs index fe19c9abb712..af74feb01fc0 100644 --- a/crates/viewer/re_renderer_examples/multiview.rs +++ b/crates/viewer/re_renderer_examples/multiview.rs @@ -13,7 +13,7 @@ use re_math::IsoTransform; use re_renderer::{ renderer::{ - GenericSkyboxDrawData, LineDrawData, LineStripFlags, MeshDrawData, GpuMeshInstance, + GenericSkyboxDrawData, GpuMeshInstance, LineDrawData, LineStripFlags, MeshDrawData, TestTriangleDrawData, }, view_builder::{OrthographicCameraMode, Projection, TargetConfiguration, ViewBuilder}, @@ -276,7 +276,8 @@ impl Example for Multiview { .map(|_| random_color(&mut rnd)) .collect_vec(); - let model_mesh_instances = crate::framework::load_rerun_mesh(re_ctx); + let model_mesh_instances = + crate::framework::load_rerun_mesh(re_ctx).expect("Failed to load rerun mesh"); let mesh_instance_positions_and_colors = lorenz_points(10.0) .iter() diff --git a/crates/viewer/re_renderer_examples/outlines.rs b/crates/viewer/re_renderer_examples/outlines.rs index c640d70d398b..9df0fab6fbbf 100644 --- a/crates/viewer/re_renderer_examples/outlines.rs +++ b/crates/viewer/re_renderer_examples/outlines.rs @@ -34,7 +34,8 @@ impl framework::Example for Outlines { Self { is_paused: false, seconds_since_startup: 0.0, - model_mesh_instances: crate::framework::load_rerun_mesh(re_ctx), + model_mesh_instances: crate::framework::load_rerun_mesh(re_ctx) + .expect("Failed to load rerun mesh"), } } diff --git a/crates/viewer/re_renderer_examples/picking.rs b/crates/viewer/re_renderer_examples/picking.rs index ea06f9b7e4da..af5ab17de139 100644 --- a/crates/viewer/re_renderer_examples/picking.rs +++ b/crates/viewer/re_renderer_examples/picking.rs @@ -86,7 +86,8 @@ impl framework::Example for Picking { }) .collect_vec(); - let model_mesh_instances = crate::framework::load_rerun_mesh(re_ctx); + let model_mesh_instances = + crate::framework::load_rerun_mesh(re_ctx).expect("Failed to load rerun mesh"); Self { point_sets,