Skip to content

Commit 5adfa10

Browse files
committed
auto merge of #9404 : blake2-ppc/rust/result-map-opt, r=cmr
std::result: Remove function `map_opt`. This function has never had any users in the tree, so this is my initiative to remove this function.
2 parents 33fef99 + 4cd3c5c commit 5adfa10

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/libstd/result.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -366,19 +366,6 @@ impl<T, E> either::AsEither<E, T> for Result<T, E> {
366366
}
367367
}
368368

369-
#[inline]
370-
#[allow(missing_doc)]
371-
pub fn map_opt<T, U: ToStr, V>(o_t: &Option<T>,
372-
op: &fn(&T) -> Result<V,U>) -> Result<Option<V>,U> {
373-
match *o_t {
374-
None => Ok(None),
375-
Some(ref t) => match op(t) {
376-
Ok(v) => Ok(Some(v)),
377-
Err(e) => Err(e)
378-
}
379-
}
380-
}
381-
382369
/// Takes each element in the iterator: if it is an error, no further
383370
/// elements are taken, and the error is returned.
384371
/// Should no error occur, a vector containing the values of each Result

0 commit comments

Comments
 (0)