Open lengyijun opened 5 months ago
I may be wrong but: We have:
if line.is_empty() || pos < line.len() { return None; }
So pos == line.len() && pos > 0. So I guess that the panic can happen only if history returns an entry that doesn't start with line. Which seems fine to me.
pos == line.len() && pos > 0
history
line
I may be wrong but: We have:
So
pos == line.len() && pos > 0
. So I guess that the panic can happen only ifhistory
returns an entry that doesn't start withline
. Which seems fine to me.