@@ -49,7 +49,7 @@ use str::{self, Utf8Error};
49
49
/// # Extracting a raw pointer to the whole C string
50
50
///
51
51
/// `CString` implements a [`as_ptr`] method through the [`Deref`]
52
- /// trait. This method will give you a `*const c_char` which you can
52
+ /// trait. This method will give you a `*const c_char` which you can
53
53
/// feed directly to extern functions that expect a nul-terminated
54
54
/// string, like C's `strdup()`.
55
55
///
@@ -70,7 +70,7 @@ use str::{self, Utf8Error};
70
70
/// Once you have the kind of slice you need (with or without a nul
71
71
/// terminator), you can call the slice's own
72
72
/// [`as_ptr`][slice.as_ptr] method to get a raw pointer to pass to
73
- /// extern functions. See the documentation for that function for a
73
+ /// extern functions. See the documentation for that function for a
74
74
/// discussion on ensuring the lifetime of the raw pointer.
75
75
///
76
76
/// [`Into`]: ../convert/trait.Into.html
@@ -130,8 +130,8 @@ pub struct CString {
130
130
/// Representation of a borrowed C string.
131
131
///
132
132
/// This type represents a borrowed reference to a nul-terminated
133
- /// array of bytes. It can be constructed safely from a `&[`[`u8`]`]`
134
- /// slice, or unsafely from a raw `*const c_char`. It can then be
133
+ /// array of bytes. It can be constructed safely from a `&[`[`u8`]`]`
134
+ /// slice, or unsafely from a raw `*const c_char`. It can then be
135
135
/// converted to a Rust [`&str`] by performing UTF-8 validation, or
136
136
/// into an owned [`CString`].
137
137
///
@@ -374,7 +374,7 @@ impl CString {
374
374
/// to undefined behavior or allocator corruption.
375
375
///
376
376
/// > **Note:** If you need to borrow a string that was allocated by
377
- /// > foreign code, use [`CStr`]. If you need to take ownership of
377
+ /// > foreign code, use [`CStr`]. If you need to take ownership of
378
378
/// > a string that was allocated by foreign code, you will need to
379
379
/// > make your own provisions for freeing it appropriately, likely
380
380
/// > with the foreign code's API to do that.
@@ -521,7 +521,7 @@ impl CString {
521
521
///
522
522
/// The returned slice does **not** contain the trailing nul
523
523
/// terminator, and it is guaranteed to not have any interior nul
524
- /// bytes. If you need the nul terminator, use
524
+ /// bytes. If you need the nul terminator, use
525
525
/// [`as_bytes_with_nul`] instead.
526
526
///
527
527
/// [`as_bytes_with_nul`]: #method.as_bytes_with_nul
@@ -1035,7 +1035,7 @@ impl CStr {
1035
1035
/// Yields a [`&str`] slice if the `CStr` contains valid UTF-8.
1036
1036
///
1037
1037
/// If the contents of the `CStr` are valid UTF-8 data, this
1038
- /// function will return the corresponding [`&str`] slice. Otherwise,
1038
+ /// function will return the corresponding [`&str`] slice. Otherwise,
1039
1039
/// it will return an error with details of where UTF-8 validation failed.
1040
1040
///
1041
1041
/// > **Note**: This method is currently implemented to check for validity
@@ -1066,7 +1066,7 @@ impl CStr {
1066
1066
///
1067
1067
/// If the contents of the `CStr` are valid UTF-8 data, this
1068
1068
/// function will return a [`Cow`]`::`[`Borrowed`]`(`[`&str`]`)`
1069
- /// with the the corresponding [`&str`] slice. Otherwise, it will
1069
+ /// with the the corresponding [`&str`] slice. Otherwise, it will
1070
1070
/// replace any invalid UTF-8 sequences with `U+FFFD REPLACEMENT
1071
1071
/// CHARACTER` and return a [`Cow`]`::`[`Owned`]`(`[`String`]`)`
1072
1072
/// with the result.
0 commit comments