From 88dbc2442e3aa59722a9e68db3d056fdc7044fa4 Mon Sep 17 00:00:00 2001 From: mattatz Date: Mon, 1 Dec 2025 14:09:32 +0900 Subject: [PATCH] Add ToPrimitive derive and repr(u8) to CellType enum --- src/model.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/model.rs b/src/model.rs index 7e46979..c325912 100644 --- a/src/model.rs +++ b/src/model.rs @@ -16,7 +16,7 @@ use std::ops::RangeInclusive; use std::path::{Path, PathBuf}; use bytemuck::{cast_slice, cast_vec}; -use num_derive::FromPrimitive; +use num_derive::{FromPrimitive, ToPrimitive}; use num_traits::ToPrimitive; /// Error type describing failure modes of various model processing tasks and validation. @@ -1839,7 +1839,8 @@ impl Cells { /// These are explicitly written in `UnstructuredGrid`s and some are referred to in `PolyData` /// datasets. For more details on each of these types see, the [VTK file /// formats](https://kitware.github.io/vtk-examples/site/VTKFileFormats/) documentation. -#[derive(Copy, Clone, PartialEq, Debug, FromPrimitive)] +#[derive(Copy, Clone, PartialEq, Debug, FromPrimitive, ToPrimitive)] +#[repr(u8)] pub enum CellType { // Linear cells Vertex = 1,