diff --git a/air/src/trace/rows.rs b/air/src/trace/rows.rs index 88b61916e5..3622d96369 100644 --- a/air/src/trace/rows.rs +++ b/air/src/trace/rows.rs @@ -7,10 +7,8 @@ use vm_core::Felt; /// Represents the types of errors that can occur when converting from and into [`RowIndex`] and /// using its operations. -/// -/// Currently only used during panic. #[derive(Debug, thiserror::Error, PartialEq, Eq)] -enum RowIndexError { +pub enum RowIndexError { #[error("value is too large to be converted into RowIndex: {0}")] InvalidSize(T), } @@ -78,10 +76,10 @@ impl From for RowIndex { /// This function will panic if the number represented by the u64 is greater than the maximum /// [`RowIndex`] value, `u32::MAX`. impl TryFrom for RowIndex { - type Error = &'static str; + type Error = RowIndexError; fn try_from(value: u64) -> Result { - let value = u32::try_from(value).map_err(|_| RowIndexError::InvalidSize(value)).unwrap(); + let value = u32::try_from(value).map_err(|_| RowIndexError::InvalidSize(value))?; Ok(RowIndex::from(value)) } }