Le 20/09/2013 20:07, Olivier Renaud a écrit :
I have one more question regarding the error handling : in DecodeError, what
does 'input_byte_offset' mean ? Is it relative to the 'invalid_byte_sequence'
or to the beginning of the decoded stream ?

Good point. I’m not sure. (Remember I make this up as we go along :).)
If it’s from the entirety of the input this would require decoders to keep count, which is unnecessary work in cases where you don’t use it. (eg. with the Replace error handling.)

So it could be from the beginning of the input in the last call to .feed() to the begining of the invalid byte sequence, *which can be negative*, in case the invalid sequence started in an earlier .feed() call.

What do you think it should be?

--
Simon Sapin
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to