Redundant Check in Rust Parsing Loop: None After is_empty() — Is It Required?
I am working on lisp interpreter, in that i am writing parser rn, i following the lisp interpreter in rust guide, in that i found this code, which is little confusing to me,
at line number 41 if we are checking for is\_empty for while loop condition, then why do we need to check None at 43,
I am not able to think of the scenario in the parser where this will happen, if parser didn't find token then it will not enter the while loop itself, right ?
i am new to rust and learning rust, completed 50% book and rustlings, so please forgive me if this is dumb question
code link:https://github.com/vishpat/lisp-rs/blob/0.0.1/src/parser.rs