mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-04 18:08:26 +00:00
Increase type safety
This commit is contained in:
parent
d6b5972183
commit
b9c38fc6cc
@ -97,11 +97,10 @@ impl Geometry<TrianglesVertex> {
|
||||
}
|
||||
|
||||
impl<V> Geometry<V> {
|
||||
pub fn new(
|
||||
device: &wgpu::Device,
|
||||
vertices: &[impl bytemuck::NoUninit],
|
||||
indices: &[u32],
|
||||
) -> Self {
|
||||
pub fn new(device: &wgpu::Device, vertices: &[V], indices: &[u32]) -> Self
|
||||
where
|
||||
V: bytemuck::NoUninit,
|
||||
{
|
||||
let Ok(num_indices) = indices.len().try_into() else {
|
||||
panic!("Unsupported number of indices: `{}`", indices.len());
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user