mirror of
https://github.com/teo3300/rust-mal.git
synced 2026-01-12 09:15:32 +01:00
Fixing empty string error
Signed-off-by: teo3300 <matteo.rogora@live.it>
This commit is contained in:
@ -99,7 +99,7 @@ impl Reader {
|
||||
if Regex::new(r"^-?[0-9]+$").unwrap().is_match(tk) {
|
||||
return Ok(Int(tk.parse::<isize>().unwrap()));
|
||||
} else if tk.starts_with('\"') {
|
||||
if tk.len() > 2 && tk.ends_with('\"') {
|
||||
if tk.len() > 1 && tk.ends_with('\"') {
|
||||
return Ok(Str(unescape_str(tk)));
|
||||
}
|
||||
return Err(MalErr::unrecoverable(
|
||||
|
||||
Reference in New Issue
Block a user