Skip to content

Commit

Permalink
fix expect![[]]
Browse files Browse the repository at this point in the history
  • Loading branch information
xxchan committed May 16, 2024
1 parent 0eba05e commit 1c9a655
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ fn locate_end(arg_start_to_eof: &str) -> Option<usize> {
// expect![[]]
'[' => {
let str_start_to_eof = arg_start_to_eof[1..].trim_start();
let str_len = find_str_lit_len(str_start_to_eof)?;
let str_len = find_str_lit_len(str_start_to_eof).unwrap_or(0);
let str_end_to_eof = &str_start_to_eof[str_len..];
let closing_brace_offset = str_end_to_eof.find(']')?;
Some((arg_start_to_eof.len() - str_end_to_eof.len()) + closing_brace_offset + 1)
Expand Down

0 comments on commit 1c9a655

Please sign in to comment.