Skip to content

Commit 06ae1be

Browse files
committed
Make doc for transpose api better
1 parent 9972ebf commit 06ae1be

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

library/core/src/option.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2037,19 +2037,19 @@ impl<T> Option<&mut T> {
20372037
impl<T, E> Option<Result<T, E>> {
20382038
/// Transposes an `Option` of a [`Result`] into a [`Result`] of an `Option`.
20392039
///
2040-
/// [`None`] will be mapped to <code>[Ok]\([None])</code>.
2041-
/// <code>[Some]\([Ok]\(\_))</code> and <code>[Some]\([Err]\(\_))</code> will be mapped to
2042-
/// <code>[Ok]\([Some]\(\_))</code> and <code>[Err]\(\_)</code>.
2040+
/// <code>[Some]\([Ok]\(\_))</code> is mapped to <code>[Ok]\([Some]\(\_))</code>,
2041+
/// <code>[Some]\([Err]\(\_))</code> is mapped to <code>[Err]\(\_)</code>,
2042+
/// and [`None`] will be mapped to <code>[Ok]\([None])</code>.
20432043
///
20442044
/// # Examples
20452045
///
20462046
/// ```
20472047
/// #[derive(Debug, Eq, PartialEq)]
20482048
/// struct SomeErr;
20492049
///
2050-
/// let x: Result<Option<i32>, SomeErr> = Ok(Some(5));
2051-
/// let y: Option<Result<i32, SomeErr>> = Some(Ok(5));
2052-
/// assert_eq!(x, y.transpose());
2050+
/// let x: Option<Result<i32, SomeErr>> = Some(Ok(5));
2051+
/// let y: Result<Option<i32>, SomeErr> = Ok(Some(5));
2052+
/// assert_eq!(x.transpose(), y);
20532053
/// ```
20542054
#[inline]
20552055
#[stable(feature = "transpose_result", since = "1.33.0")]

0 commit comments

Comments
 (0)