File tree Expand file tree Collapse file tree 3 files changed +2
-8
lines changed Expand file tree Collapse file tree 3 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -135,9 +135,6 @@ next_allowed_tokens = guide.advance(allowed_tokens[-1])
135135
136136# To check if Guide is finished :
137137guide . is_finished ()
138-
139- # If it 's finished then this assertion holds :
140- assert guide . get_tokens () == [vocabulary . get_eos_token_id ()]
141138```
142139
143140## How to contribute?
Original file line number Diff line number Diff line change @@ -226,9 +226,6 @@ impl Index {
226226
227227 /// Returns transition state for a given state and token id or `None` otherwise.
228228 pub fn next_state ( & self , state : & StateId , token_id : & TokenId ) -> Option < StateId > {
229- if token_id == & self . eos_token_id {
230- return None ;
231- }
232229 Some ( * self . transitions . get ( state) ?. get ( token_id) ?)
233230 }
234231
@@ -284,7 +281,7 @@ mod tests {
284281 assert_eq ! ( index. next_state( & initial_state, token_id) , Some ( state) ) ;
285282 assert ! ( index. is_final_state( & state) ) ;
286283
287- assert_eq ! ( index. next_state( & state, & eos_token_id) , None ) ;
284+ assert_eq ! ( index. next_state( & state, & eos_token_id) , Some ( state ) ) ;
288285 assert_eq ! ( index. next_state( & state, token_id) , None ) ;
289286 }
290287
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ impl<'a> Parser<'a> {
6565
6666 fn parse_empty_object ( & mut self ) -> Result < String > {
6767 // JSON Schema Spec: Empty object means unconstrained, any json type is legal
68- let types = vec ! [
68+ let types = [
6969 json ! ( { "type" : "boolean" } ) ,
7070 json ! ( { "type" : "null" } ) ,
7171 json ! ( { "type" : "number" } ) ,
You can’t perform that action at this time.
0 commit comments