Skip to content

Commit 98a5c7d

Browse files
authored
Rollup merge of #67985 - dtolnay:cstr, r=Mark-Simulacrum
Remove insignificant notes from CStr documentation The to_str and to_string_lossy methods contain a note about the behavior possibly changing in the future. But those notes are referring to a distinction that is not observable in the API. Whether or not the UTF-8 check knows the string length ahead of time, these methods require linear time.
2 parents b687461 + 48add54 commit 98a5c7d

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/libstd/ffi/c_str.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,11 +1187,6 @@ impl CStr {
11871187
/// function will return the corresponding [`&str`] slice. Otherwise,
11881188
/// it will return an error with details of where UTF-8 validation failed.
11891189
///
1190-
/// > **Note**: This method is currently implemented to check for validity
1191-
/// > after a constant-time cast, but it is planned to alter its definition
1192-
/// > in the future to perform the length calculation in addition to the
1193-
/// > UTF-8 check whenever this method is called.
1194-
///
11951190
/// [`&str`]: ../primitive.str.html
11961191
///
11971192
/// # Examples
@@ -1220,11 +1215,6 @@ impl CStr {
12201215
/// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD] and return a
12211216
/// [`Cow`]`::`[`Owned`]`(`[`String`]`)` with the result.
12221217
///
1223-
/// > **Note**: This method is currently implemented to check for validity
1224-
/// > after a constant-time cast, but it is planned to alter its definition
1225-
/// > in the future to perform the length calculation in addition to the
1226-
/// > UTF-8 check whenever this method is called.
1227-
///
12281218
/// [`Cow`]: ../borrow/enum.Cow.html
12291219
/// [`Borrowed`]: ../borrow/enum.Cow.html#variant.Borrowed
12301220
/// [`Owned`]: ../borrow/enum.Cow.html#variant.Owned

0 commit comments

Comments
 (0)