Skip to content

Commit 6c86da2

Browse files
committed
Make wording around 0-cost casts more precise
1 parent 6b99ade commit 6c86da2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/libstd/ffi/c_str.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,9 +1026,9 @@ impl CStr {
10261026
/// The returned slice will **not** contain the trailing nul terminator that this C
10271027
/// string has.
10281028
///
1029-
/// > **Note**: This method is currently implemented as a 0-cost cast, but
1030-
/// > it is planned to alter its definition in the future to perform the
1031-
/// > length calculation whenever this method is called.
1029+
/// > **Note**: This method is currently implemented as a constant-time
1030+
/// > cast, but it is planned to alter its definition in the future to
1031+
/// > perform the length calculation whenever this method is called.
10321032
///
10331033
/// # Examples
10341034
///
@@ -1077,9 +1077,9 @@ impl CStr {
10771077
/// it will return an error with details of where UTF-8 validation failed.
10781078
///
10791079
/// > **Note**: This method is currently implemented to check for validity
1080-
/// > after a 0-cost cast, but it is planned to alter its definition in the
1081-
/// > future to perform the length calculation in addition to the UTF-8
1082-
/// > check whenever this method is called.
1080+
/// > after a constant-time cast, but it is planned to alter its definition
1081+
/// > in the future to perform the length calculation in addition to the
1082+
/// > UTF-8 check whenever this method is called.
10831083
///
10841084
/// [`&str`]: ../primitive.str.html
10851085
///
@@ -1110,9 +1110,9 @@ impl CStr {
11101110
/// with the result.
11111111
///
11121112
/// > **Note**: This method is currently implemented to check for validity
1113-
/// > after a 0-cost cast, but it is planned to alter its definition in the
1114-
/// > future to perform the length calculation in addition to the UTF-8
1115-
/// > check whenever this method is called.
1113+
/// > after a constant-time cast, but it is planned to alter its definition
1114+
/// > in the future to perform the length calculation in addition to the
1115+
/// > UTF-8 check whenever this method is called.
11161116
///
11171117
/// [`Cow`]: ../borrow/enum.Cow.html
11181118
/// [`Borrowed`]: ../borrow/enum.Cow.html#variant.Borrowed

0 commit comments

Comments
 (0)