Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.3: Backports #2389

Merged
merged 13 commits into from Apr 10, 2021
Merged

0.3: Backports #2389

merged 13 commits into from Apr 10, 2021

Commits on Apr 10, 2021

  1. Add future::SelectAll::into_inner (rust-lang#2363)

    When select all is not yet finished (for example, due to timeout),
    underlying futures may need to be extracted to be updated to construct
    a fresh select all.
    stepancheg authored and taiki-e committed Apr 10, 2021
    Copy the full SHA
    fc8e27f View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    0175d31 View commit details
    Browse the repository at this point in the history
  3. Revert import changes in tests

    After rust-lang#2216, these redundant imports are unneeded.
    This reverts almost all of rust-lang#2101.
    This also includes some minor cleanup of imports in tests.
    taiki-e committed Apr 10, 2021
    Copy the full SHA
    d723ae0 View commit details
    Browse the repository at this point in the history
  4. Unify test file naming

    If the test is related to a particular module, use the file name
    starting with the module name.
    taiki-e committed Apr 10, 2021
    Copy the full SHA
    b4cbf4b View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    5bd6b1c View commit details
    Browse the repository at this point in the history
  6. Add .editorconfig

    Add `.editorconfig` with sensible defaults.
    
    Many editors understand editorconfig, and the most important one
    here is IntelliJ IDEA which does not insert file trailing newline
    by default, but does it out of box this provided `.editorconfig`.
    stepancheg authored and taiki-e committed Apr 10, 2021
    Copy the full SHA
    a6c681c View commit details
    Browse the repository at this point in the history
  7. Allow calling UnboundedReceiver::try_next after None

    Allow calling `UnboundedReceiver::try_next` and `Receiver::try_next`
    after `None`: do not panic.
    
    Not-panicking is equally safe, and does not have negative performance
    implication.
    
    It is irrelevant for `Stream` implementation to panic or not (because
    `Stream` behavior is unspecified after `None`), but panicking in
    `try_next` just complicates the interface: returned `Ok(None)` is
    reasonable assumption to have.
    
    Consider this use case: drain the queue on drop by performing
    app-specific cleanup of queued messages.
    
    The obvious implementation would be:
    
    ```
    impl Drop for MyReceiverWrapper {
        fn drop(&mut self) {
            while let Ok(Some(m)) self.try_next() {
                cleanup(m);
            }
        }
    }
    ```
    
    Without this change, I cannot even say for sure how this code need
    to be implemented to avoid panicking. E. g. is `is_closed` enough
    or some additional checks need to be performed?
    stepancheg authored and taiki-e committed Apr 10, 2021
    Copy the full SHA
    41fd64b View commit details
    Browse the repository at this point in the history
  8. Add Receiver::try_next return value descriptions

    Similar change applied to `UnboundedReceiver::try_next` a few commits ago.
    stepancheg authored and taiki-e committed Apr 10, 2021
    Copy the full SHA
    0f03ef4 View commit details
    Browse the repository at this point in the history
  9. Remove empty line from futures example

    pickfire authored and taiki-e committed Apr 10, 2021
    Copy the full SHA
    b8214c2 View commit details
    Browse the repository at this point in the history
  10. Copy the full SHA
    5eab276 View commit details
    Browse the repository at this point in the history
  11. Copy the full SHA
    c25a7ff View commit details
    Browse the repository at this point in the history
  12. Copy the full SHA
    17d6410 View commit details
    Browse the repository at this point in the history
  13. Copy the full SHA
    74574ab View commit details
    Browse the repository at this point in the history