Utf8Error::valid_up_to: make documented semantics more precise/useful

This commit is contained in:
Simon Sapin 2015-09-24 18:54:12 +02:00
parent 8fe79bdfda
commit 081278eb7a

View File

@ -115,8 +115,8 @@ impl Utf8Error {
/// Returns the index in the given string up to which valid UTF-8 was /// Returns the index in the given string up to which valid UTF-8 was
/// verified. /// verified.
/// ///
/// Starting at the index provided, but not necessarily at it precisely, an /// It is the maximum index such that `from_utf8(input[..index])`
/// invalid UTF-8 encoding sequence was found. /// would return `Some(_)`.
#[unstable(feature = "utf8_error", reason = "method just added", #[unstable(feature = "utf8_error", reason = "method just added",
issue = "27734")] issue = "27734")]
pub fn valid_up_to(&self) -> usize { self.valid_up_to } pub fn valid_up_to(&self) -> usize { self.valid_up_to }