Closed olson-sean-k closed 6 months ago
This was fixed in 68b94ff, which completely refactored the determination of invariant text prefix and token index (where the panic previously occurred) and introduces some APIs to improve the ergonomics of empty globs. However, that change did not focus on this issue and relevant tests were not added until 2570081.
Calling
Glob::partition
on an emptyGlob
panics! This function should never panic and in this case should probably return an emptyPathBuf
and the emptyGlob
as is.This bug raises some additional concerns that are worth pointing out. The notion of an empty glob (as with empty paths and especially empty path components) is a bit strange and annoying. Moreover, the API of
Glob::partition
is a victim of these empty values, because it returns(PathBuf, Glob<'_>)
! There is no (sane) way for clients to determine if either part is empty.