Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kc611 committed Aug 25, 2024
1 parent 1de92be commit 0c1816e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/python_bindings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::regex::get_token_transition_keys_internal;
use crate::regex::get_vocabulary_transition_keys_internal;
use crate::regex::state_scan_tokens_internal;
use crate::regex::walk_fsm_internal;
use pyo3::exceptions::PyValueError;
use pyo3::prelude::*;
use pyo3::types::PyDict;
use pyo3::wrap_pyfunction;
Expand Down Expand Up @@ -158,7 +159,7 @@ pub fn create_fsm_index_end_to_end<'py>(
new_dict.set_item(token_id, end_state).unwrap();
states_to_token_subsets
.set_item(start_state, new_dict)
.unwrap();
.map_err(|e| PyValueError::new_err(format!("Failed to set item: {}", e)))?;
}

if !seen.contains(&end_state) {
Expand Down

0 comments on commit 0c1816e

Please sign in to comment.