rust-dc / fish-manpage-completions

Straight port of fish-shell's Python manpage completion script to Rust
19 stars 8 forks source link

fix(drain): panic when different length #110

Closed pickfire closed 2 years ago

pickfire commented 3 years ago

Python slice behavior works even when the end length is not achieved but just the output length will be shorter but rust length requires it to hit exactly that length and when the length is not enough or within a boundary, it will panic. So we have to count by character boundary and at the same time prevent the characters length from overflowing.

I hit some panics when running it through my system files when I wanted to test out the progress bar (done but still testing).