mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Small round of typo fixes
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
This commit is contained in:
parent
4827ceecb9
commit
849d89b031
@ -1856,7 +1856,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// Coverting in the other direction from a `&mut T`
|
/// Converting in the other direction from a `&mut T`
|
||||||
/// to an `&UnsafeCell<T>` is allowed:
|
/// to an `&UnsafeCell<T>` is allowed:
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
|
@ -46,7 +46,7 @@ These functions are equivalent, they either return the inner value if the
|
|||||||
`Result` is `Ok` or panic if the `Result` is `Err` printing the inner error
|
`Result` is `Ok` or panic if the `Result` is `Err` printing the inner error
|
||||||
as the source. The only difference between them is that with `expect` you
|
as the source. The only difference between them is that with `expect` you
|
||||||
provide a panic error message to be printed alongside the source, whereas
|
provide a panic error message to be printed alongside the source, whereas
|
||||||
`unwrap` has a default message indicating only that you unwraped an `Err`.
|
`unwrap` has a default message indicating only that you unwrapped an `Err`.
|
||||||
|
|
||||||
Of the two, `expect` is generally preferred since its `msg` field allows you
|
Of the two, `expect` is generally preferred since its `msg` field allows you
|
||||||
to convey your intent and assumptions which makes tracking down the source
|
to convey your intent and assumptions which makes tracking down the source
|
||||||
|
@ -275,7 +275,7 @@ impl f32 {
|
|||||||
/// This result is not an element of the function's codomain, but it is the
|
/// This result is not an element of the function's codomain, but it is the
|
||||||
/// closest floating point number in the real numbers and thus fulfills the
|
/// closest floating point number in the real numbers and thus fulfills the
|
||||||
/// property `self == self.div_euclid(rhs) * rhs + self.rem_euclid(rhs)`
|
/// property `self == self.div_euclid(rhs) * rhs + self.rem_euclid(rhs)`
|
||||||
/// approximatively.
|
/// approximately.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
@ -275,7 +275,7 @@ impl f64 {
|
|||||||
/// This result is not an element of the function's codomain, but it is the
|
/// This result is not an element of the function's codomain, but it is the
|
||||||
/// closest floating point number in the real numbers and thus fulfills the
|
/// closest floating point number in the real numbers and thus fulfills the
|
||||||
/// property `self == self.div_euclid(rhs) * rhs + self.rem_euclid(rhs)`
|
/// property `self == self.div_euclid(rhs) * rhs + self.rem_euclid(rhs)`
|
||||||
/// approximatively.
|
/// approximately.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
@ -362,7 +362,7 @@ impl IO_STATUS_BLOCK {
|
|||||||
|
|
||||||
pub type LPOVERLAPPED_COMPLETION_ROUTINE = unsafe extern "system" fn(
|
pub type LPOVERLAPPED_COMPLETION_ROUTINE = unsafe extern "system" fn(
|
||||||
dwErrorCode: DWORD,
|
dwErrorCode: DWORD,
|
||||||
dwNumberOfBytesTransfered: DWORD,
|
dwNumberOfBytesTransferred: DWORD,
|
||||||
lpOverlapped: *mut OVERLAPPED,
|
lpOverlapped: *mut OVERLAPPED,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -324,17 +324,18 @@ impl AnonPipe {
|
|||||||
let mut async_result: Option<AsyncResult> = None;
|
let mut async_result: Option<AsyncResult> = None;
|
||||||
struct AsyncResult {
|
struct AsyncResult {
|
||||||
error: u32,
|
error: u32,
|
||||||
transfered: u32,
|
transferred: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
// STEP 3: The callback.
|
// STEP 3: The callback.
|
||||||
unsafe extern "system" fn callback(
|
unsafe extern "system" fn callback(
|
||||||
dwErrorCode: u32,
|
dwErrorCode: u32,
|
||||||
dwNumberOfBytesTransfered: u32,
|
dwNumberOfBytesTransferred: u32,
|
||||||
lpOverlapped: *mut c::OVERLAPPED,
|
lpOverlapped: *mut c::OVERLAPPED,
|
||||||
) {
|
) {
|
||||||
// Set `async_result` using a pointer smuggled through `hEvent`.
|
// Set `async_result` using a pointer smuggled through `hEvent`.
|
||||||
let result = AsyncResult { error: dwErrorCode, transfered: dwNumberOfBytesTransfered };
|
let result =
|
||||||
|
AsyncResult { error: dwErrorCode, transferred: dwNumberOfBytesTransferred };
|
||||||
*(*lpOverlapped).hEvent.cast::<Option<AsyncResult>>() = Some(result);
|
*(*lpOverlapped).hEvent.cast::<Option<AsyncResult>>() = Some(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,7 +366,7 @@ impl AnonPipe {
|
|||||||
// STEP 4: Return the result.
|
// STEP 4: Return the result.
|
||||||
// `async_result` is always `Some` at this point
|
// `async_result` is always `Some` at this point
|
||||||
match result.error {
|
match result.error {
|
||||||
c::ERROR_SUCCESS => Ok(result.transfered as usize),
|
c::ERROR_SUCCESS => Ok(result.transferred as usize),
|
||||||
error => Err(io::Error::from_raw_os_error(error as _)),
|
error => Err(io::Error::from_raw_os_error(error as _)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user