Skip to content

Commit 0264510

Browse files
ffi/c_str.rs: Use only one space after a period ending a sentence
1 parent a9a4ce6 commit 0264510

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/libstd/ffi/c_str.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use str::{self, Utf8Error};
4949
/// # Extracting a raw pointer to the whole C string
5050
///
5151
/// `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
5353
/// feed directly to extern functions that expect a nul-terminated
5454
/// string, like C's `strdup()`.
5555
///
@@ -70,7 +70,7 @@ use str::{self, Utf8Error};
7070
/// Once you have the kind of slice you need (with or without a nul
7171
/// terminator), you can call the slice's own
7272
/// [`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
7474
/// discussion on ensuring the lifetime of the raw pointer.
7575
///
7676
/// [`Into`]: ../convert/trait.Into.html
@@ -130,8 +130,8 @@ pub struct CString {
130130
/// Representation of a borrowed C string.
131131
///
132132
/// 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
135135
/// converted to a Rust [`&str`] by performing UTF-8 validation, or
136136
/// into an owned [`CString`].
137137
///
@@ -374,7 +374,7 @@ impl CString {
374374
/// to undefined behavior or allocator corruption.
375375
///
376376
/// > **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
378378
/// > a string that was allocated by foreign code, you will need to
379379
/// > make your own provisions for freeing it appropriately, likely
380380
/// > with the foreign code's API to do that.
@@ -521,7 +521,7 @@ impl CString {
521521
///
522522
/// The returned slice does **not** contain the trailing nul
523523
/// 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
525525
/// [`as_bytes_with_nul`] instead.
526526
///
527527
/// [`as_bytes_with_nul`]: #method.as_bytes_with_nul
@@ -1035,7 +1035,7 @@ impl CStr {
10351035
/// Yields a [`&str`] slice if the `CStr` contains valid UTF-8.
10361036
///
10371037
/// 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,
10391039
/// it will return an error with details of where UTF-8 validation failed.
10401040
///
10411041
/// > **Note**: This method is currently implemented to check for validity
@@ -1066,7 +1066,7 @@ impl CStr {
10661066
///
10671067
/// If the contents of the `CStr` are valid UTF-8 data, this
10681068
/// 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
10701070
/// replace any invalid UTF-8 sequences with `U+FFFD REPLACEMENT
10711071
/// CHARACTER` and return a [`Cow`]`::`[`Owned`]`(`[`String`]`)`
10721072
/// with the result.

0 commit comments

Comments
 (0)