Skip to content

Commit 081278e

Browse files
committed
Utf8Error::valid_up_to: make documented semantics more precise/useful
1 parent 8fe79bd commit 081278e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/str/mod.rs

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

0 commit comments

Comments
 (0)