-
Notifications
You must be signed in to change notification settings - Fork 22
Conversation
I'm worried about the technical debt that this PR would introduce because it comprises of lots of tricks and quite unintuitive control flow, despite of being working. How about using a macro instead? macro_rules! send {
($req:expr) => {
$req.send().await
};
}
// Our hypothetical request.
struct Request;
impl Request {
async fn send(self) -> i32 {
123
}
}
fn main() {
let _123 = async {
let req = Request;
send!(req)
};
} It's a pity that we can't do |
Also related to: rust-lang/rust#67982. |
I don't think that macro would accomplish much.
I also don't think that this code is too complicated. It just does simple bot-wrapper-things + implements |
I agree that Concerning the PR code. I was confused that it uses unreachable expressions, but others conceived me that it's okay for Rusty futures, so nevermind. |
Well, if |
I understand; I meant that it would not break backward compatibility in user's code (at least in most cases). |
Co-authored-by: Temirkhan Myrzamadi <[email protected]>
Co-authored-by: Temirkhan Myrzamadi <[email protected]>
Co-authored-by: Temirkhan Myrzamadi <[email protected]>
No description provided.