about summary refs log tree commit diff
path: root/src/libcore/result.rs
AgeCommit message (Collapse)AuthorLines
2019-09-04Auto merge of #63166 - ksqsf:master, r=alexcrichtonbors-0/+81
Add Result::cloned{,_err} and Result::copied{,_err} This is a little nice addition to `Result`. 1. I'm not sure how useful are `cloned_err` and `copied_err`, but for the sake of completeness they are here. 2. Naming is similar to `map`/`map_err`. I thought about naming `cloned` as `cloned_ok` and add another method called `cloned` that clones both Ok and Err, but `cloned_ok` should be more prevalent than `cloned_both`.
2019-08-02Remove Err variants of cloned and copiedksqsf-79/+0
2019-08-01Fix doc testsksqsf-17/+17
2019-08-01Revert "cloned/copied"ksqsf-140/+4
This reverts commit 6c130817623426697d8ebdf5d505487bd11ee2f6.
2019-08-01Rename {copied,cloned} to {copied,cloned}_ok, and add {copied,cloned} to ↵ksqsf-4/+140
copy/clone both Ok and Err
2019-08-01Make these methods publicksqsf-8/+8
2019-08-01Fix issue and implksqsf-9/+9
2019-08-01Add Result::cloned{,_err} and Result::copied{,_err}ksqsf-0/+160
2019-07-29Use internal iteration in the Sum and Product impls of Result and OptionTim Vermeulen-2/+2
2019-07-27Refactoring use commun code between option, result and accumStargateur-34/+2
2019-07-18Use DerefMutYuki Okushi-1/+1
2019-07-18renamed `inner_deref` feature's `deref*()` methods `as_deref*()` as per ↵Brad Gibson-15/+48
discussion https://github.com/rust-lang/rust/issues/50264
2019-07-17Auto merge of #62596 - cuviper:expect_none, r=rkruppebors-5/+5
Add Option::expect_none(msg) and unwrap_none() These are `Option` analogues to `Result::expect_err` and `unwrap_err`.
2019-07-12Rollup merge of #62431 - czipperz:add-messages-to-must-use-is_-methods, ↵Mazdak Farrokhzad-2/+2
r=scottmcm Add messages to `Option`'s and `Result`'s `must_use` annotation for `is_*` r? @RalfJung
2019-07-11Make cold unwraps take &dyn DebugJosh Stone-5/+5
2019-07-07Implement Option::contains, Result::contains and Result::contains_errSimon Ochsenreither-0/+52
This increases consistency with other common data structures.
2019-07-05Add messages to Option and Result must_use for is_*Chris Gregory-2/+2
2019-06-01Implement Clone::clone_from for Result.Mara Bos-1/+22
2019-04-19libcore: deny more...Mazdak Farrokhzad-2/+2
2019-04-18libcore => 2018Taiki Endo-3/+3
2019-04-08Add must_use annotations to Result::is_ok and is_errAlex Gaynor-0/+2
2019-03-25add missing bracesFelix S Klock II-2/+2
add missing braces analogous to those suggested by killercup
2019-03-22Expand `impl FromIterator for Result` doc to include examples of `Err` and ↵Felix S. Klock II-0/+28
early termination.
2019-03-15Option and Result: Add references to documentation of as_ref and as_mutChris Gregory-2/+2
2019-03-11impl FromIterator for Result: Use assert_eq! instead of assert!Chris Gregory-1/+1
2019-02-10libs: doc commentsAlexander Regueiro-1/+1
2019-01-13stabilize transpose_result in 1.33Mazdak Farrokhzad-3/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-09-29Use impl_header_lifetime_elision in libcoreScott McMurray-8/+8
2018-09-12Rollup merge of #53777 - ivanbakel:result_map_or_else, r=alexcrichtonkennytm-0/+30
Implemented map_or_else for Result<T, E> Fulfills #53268 The example is ripped from `Option::map_or_else`, with the types corrected.
2018-09-06Fix invalid urlsGuillaume Gomez-9/+3
2018-08-30Added feature attribute to example code in map_or_else docIsaac van Bakel-0/+1
2018-08-29Corrected type variable output T -> U in Result::map_or_elseIsaac van Bakel-1/+1
2018-08-29Corrected feature status of Result::map_or_elseIsaac van Bakel-1/+1
map_or_else is now correctly labelled unstable and points to the tracking issue on rust-lang/rust
2018-08-29Corrected bad typing in Result::map_or_else docIsaac van Bakel-2/+2
The error value now includes the type of the success. The success value now includes the type of the error.
2018-08-29Corrected feature name for map_or_elseIsaac van Bakel-1/+1
2018-08-29Implemented map_or_else for Result<T, E>Isaac van Bakel-0/+29
2018-08-09inline some short functionsM Farkas-Dyck-0/+4
2018-07-29resolved upstream merge conflictsBrad Gibson-1/+1
2018-05-07Add explanation for #[must_use] on ResultManish Goregaokar-1/+1
2018-04-27separated inner_deref Result implsBrad Gibson-1/+7
2018-04-26cleaned up #[unstable] attributesBrad Gibson-3/+1
2018-04-26refactored to implement without traitBrad Gibson-57/+34
2018-04-26added DerefOption and DerefResult + tests to stdBrad Gibson-1/+58
2018-03-03core: Update stability attributes for FusedIteratorUlrik Sverdrup-3/+3
2018-03-03core: Stabilize FusedIteratorUlrik Sverdrup-3/+3
FusedIterator is a marker trait that promises that the implementing iterator continues to return `None` from `.next()` once it has returned `None` once (and/or `.next_back()`, if implemented). The effects of FusedIterator are already widely available through `.fuse()`, but with stable `FusedIterator`, stable Rust users can implement this trait for their iterators when appropriate.
2018-01-10Add transpose conversions for Option and ResultTaylor Cramer-0/+29
These impls are useful when working with combinator methods that expect an option or a result, but you have a Result<Option<T>, E> instead of an Option<Result<T, E>> or vice versa.
2017-12-07Rollup merge of #46548 - jonathanstrong:master, r=dtolnayGuillaume Gomez-0/+10
Recommends lazily evaluated alternatives for `Option::or` and `Result::or` Adds language to docs for `Option` and `Result` recommending the use of lazily evaluated alternatives when appropriate. These comments are intended to echo a [clippy lint] on the same topic. The [reddit discussion] may also be of interest. [clippy lint]: https://rust-lang-nursery.github.io/rust-clippy/master/index.html#or_fun_call [reddit discussion]: https://www.reddit.com/r/rust/comments/7hutqn/perils_of_optionor_and_resultor/
2017-12-07adds links to methods, removes trailing whitespaceJonathan Strong-4/+6
2017-12-06Adds language to the documentation for `Option` and `Result` suggestingJonathan Strong-0/+8
the use of lazily evaluated alternatives when appropriate. These comments are intended to echo a clippy lint on the same topic (see https://rust-lang-nursery.github.io/rust-clippy/master/index.html#or_fun_call)