From 081278eb7acc761f583351e846ebad21c88331ff Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Thu, 24 Sep 2015 18:54:12 +0200 Subject: [PATCH] Utf8Error::valid_up_to: make documented semantics more precise/useful --- src/libcore/str/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 69ebcb1ab7e14..456e89d472126 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -115,8 +115,8 @@ impl Utf8Error { /// Returns the index in the given string up to which valid UTF-8 was /// verified. /// - /// Starting at the index provided, but not necessarily at it precisely, an - /// invalid UTF-8 encoding sequence was found. + /// It is the maximum index such that `from_utf8(input[..index])` + /// would return `Some(_)`. #[unstable(feature = "utf8_error", reason = "method just added", issue = "27734")] pub fn valid_up_to(&self) -> usize { self.valid_up_to }