summaryrefslogtreecommitdiff
path: root/src/libcore/result.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove licensesMark Rousskov2018-12-251-10/+0
|
* Use impl_header_lifetime_elision in libcoreScott McMurray2018-09-291-8/+8
|
* Rollup merge of #53777 - ivanbakel:result_map_or_else, r=alexcrichtonkennytm2018-09-121-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.
| * Added feature attribute to example code in map_or_else docIsaac van Bakel2018-08-301-0/+1
| |
| * Corrected type variable output T -> U in Result::map_or_elseIsaac van Bakel2018-08-291-1/+1
| |
| * Corrected feature status of Result::map_or_elseIsaac van Bakel2018-08-291-1/+1
| | | | | | | | | | map_or_else is now correctly labelled unstable and points to the tracking issue on rust-lang/rust
| * Corrected bad typing in Result::map_or_else docIsaac van Bakel2018-08-291-2/+2
| | | | | | | | | | The error value now includes the type of the success. The success value now includes the type of the error.
| * Corrected feature name for map_or_elseIsaac van Bakel2018-08-291-1/+1
| |
| * Implemented map_or_else for Result<T, E>Isaac van Bakel2018-08-291-0/+29
| |
* | Fix invalid urlsGuillaume Gomez2018-09-061-9/+3
|/
* inline some short functionsM Farkas-Dyck2018-08-091-0/+4
|
* resolved upstream merge conflictsBrad Gibson2018-07-291-1/+1
|\
| * Add explanation for #[must_use] on ResultManish Goregaokar2018-05-071-1/+1
| |
* | separated inner_deref Result implsBrad Gibson2018-04-271-1/+7
| |
* | cleaned up #[unstable] attributesBrad Gibson2018-04-261-3/+1
| |
* | refactored to implement without traitBrad Gibson2018-04-261-57/+34
| |
* | added DerefOption and DerefResult + tests to stdBrad Gibson2018-04-261-1/+58
|/
* core: Update stability attributes for FusedIteratorUlrik Sverdrup2018-03-031-3/+3
|
* core: Stabilize FusedIteratorUlrik Sverdrup2018-03-031-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.
* Add transpose conversions for Option and ResultTaylor Cramer2018-01-101-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.
* Rollup merge of #46548 - jonathanstrong:master, r=dtolnayGuillaume Gomez2017-12-071-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/
| * adds links to methods, removes trailing whitespaceJonathan Strong2017-12-071-4/+6
| |
| * Adds language to the documentation for `Option` and `Result` suggestingJonathan Strong2017-12-061-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)
* | Mention the name of ? in Result's docssteveklabnik2017-12-051-4/+4
|/ | | | | | | Fixes #42725 or at least, this is the best we can really do. #35946 is tracking better errors already, so that should cover the other part of it.
* core: derive Clone for result::IntoIterJosh Stone2017-10-101-1/+1
| | | | | | It appears to be a simple oversight that `result::IntoIter<T>` doesn't implement `Clone` (where `T: Clone`). We do already have `Clone` for `result::Iter`, as well as the similar `option::IntoIter` and `Iter`.
* Add missing urls for Result structGuillaume Gomez2017-08-181-27/+73
|
* Fixed all unnecessary muts in language coreIsaac van Bakel2017-08-011-1/+1
|
* Simplify FromIterator example of ResultGeorg Brandl2017-06-091-6/+3
|
* Give the `try_trait` feature its own tracking issueScott McMurray2017-05-311-1/+1
|
* Lower `?` to `Try` instead of `Carrier`Scott McMurray2017-05-251-0/+19
| | | | | The easy parts of RFC 1859. (Just the trait and the lowering, none of the error message improvements nor the insta-stable impl for Option.)
* Fix external doc errorsGuillaume Gomez2017-03-281-1/+1
|
* Various fixes to wording consistency in the docsStjepan Glavina2017-03-221-2/+2
|
* Stabilize expect_err feature, closes #39041Aaron Turon2017-03-171-2/+1
|
* Sustitutes try! for ? in the Result documentationJordi Polo2017-02-121-23/+15
|
* std: Stabilize APIs for the 1.16.0 releaseAlex Crichton2017-01-251-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes #27788 Closes #35553 Closes #35774 Closes #36436 Closes #36949 Closes #37079 Closes #37087 Closes #37516 Closes #37827 Closes #37916 Closes #37966 Closes #38080
* expect_err for Result.Clar Charr2017-01-131-0/+25
|
* doc: Explain meaning of Result iters and link to factory functions.Martin Pool2016-12-131-3/+26
|
* Auto merge of #37306 - bluss:trusted-len, r=alexcrichtonbors2016-11-041-1/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Iterator trait TrustedLen to enable better FromIterator / Extend This trait attempts to improve FromIterator / Extend code by enabling it to trust the iterator to produce an exact number of elements, which means that reallocation needs to happen only once and is moved out of the loop. `TrustedLen` differs from `ExactSizeIterator` in that it attempts to include _more_ iterators by allowing for the case that the iterator's len does not fit in `usize`. Consumers must check for this case (for example they could panic, since they can't allocate a collection of that size). For example, chain can be TrustedLen and all numerical ranges can be TrustedLen. All they need to do is to report an exact size if it fits in `usize`, and `None` as the upper bound otherwise. The trait describes its contract like this: ``` An iterator that reports an accurate length using size_hint. The iterator reports a size hint where it is either exact (lower bound is equal to upper bound), or the upper bound is `None`. The upper bound must only be `None` if the actual iterator length is larger than `usize::MAX`. The iterator must produce exactly the number of elements it reported. This trait must only be implemented when the contract is upheld. Consumers of this trait must inspect `.size_hint()`’s upper bound. ``` Fixes #37232
| * Link the tracking issue for TrustedLenUlrik Sverdrup2016-11-041-3/+3
| |
| * Implement TrustedLen for more iteratorsUlrik Sverdrup2016-10-201-1/+10
| |
* | Add tracking issue number to Result::unwrap_or_default unstable annotation.Mark-Simulacrum2016-11-011-1/+1
| |
* | Auto merge of #37299 - devonhollowood:result-unwrap-or-default, r=alexcrichtonbors2016-11-011-0/+38
|\ \ | | | | | | | | | | | | | | | Add `unwrap_or_default` method to `Result` Fixes #37025
| * | Fix use of `result_unwrap_or_default` featureDevon Hollowood2016-10-211-0/+2
| | |
| * | Make `Result`'s `unwrap_or_default` unstableDevon Hollowood2016-10-201-3/+6
| | |
| * | Add `unwrap_or_default` method to `Result`Devon Hollowood2016-10-191-0/+33
| |/
* | Changed most vec! invocations to use square bracesiirelu2016-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
* | Add size hint to Result's FromIterator implementation.Mark-Simulacrum2016-10-251-0/+5
|/
* Improve Result docggomez2016-09-111-36/+59
|
* Indicate where `core::result::IntoIter` is created.Corey Farwell2016-09-031-1/+7
|
* Use `#[prelude_import]` in `libcore`.Jeffrey Seyfried2016-08-241-7/+1
|