-
-
Notifications
You must be signed in to change notification settings - Fork 8
chore: Bump Rust edition to 2024 #710
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,14 +123,19 @@ pub fn error_full_message(err: &dyn std::error::Error) -> String { | |
| /// Propagates `Ok(true)` and `Err(_)` from `stream`, otherwise returns `Ok(false)`. | ||
| pub async fn trystream_any<S: Stream<Item = Result<bool, E>>, E>(stream: S) -> Result<bool, E> { | ||
| pin_mut!(stream); | ||
| while let Some(value) = stream.next().await { | ||
| if let Ok(true) | Err(_) = value { | ||
| return value; | ||
| loop { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I personally found the existing code a bit easier to read to be honest.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Me too, I agree
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In that case I suggest we slap a |
||
| let next_item = stream.next().await; | ||
| match next_item { | ||
| Some(value) => { | ||
| if let Ok(true) | Err(_) = value { | ||
| return value; | ||
| } | ||
| } | ||
| None => break, | ||
| } | ||
| } | ||
| Ok(false) | ||
| } | ||
|
|
||
| /// Concatenate chunks of bytes, short-circuiting on [`Err`]. | ||
| /// | ||
| /// This is a byte-oriented equivalent to [`Iterator::collect::<Result<String, _>>`](`Iterator::collect`). | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a bit of mixed feelings about touching rust/p12. As documented in rust/p12/README.md it's a fork of https://github.com/hjiayz/p12/. We can hopefully get rid of it eventually.
So it's nice to maintain it, on the other hand this increases the diff to upstream...