2019-10-06 23:14:34 +01:00
|
|
|
//@ edition:2018
|
2023-05-07 18:38:52 +00:00
|
|
|
//@ check-pass
|
2022-10-01 12:19:31 +02:00
|
|
|
|
2019-10-06 23:14:34 +01:00
|
|
|
use std::any::Any;
|
|
|
|
use std::future::Future;
|
|
|
|
|
|
|
|
struct Client(Box<dyn Any + Send>);
|
|
|
|
|
|
|
|
impl Client {
|
|
|
|
fn status(&self) -> u16 {
|
|
|
|
200
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-13 14:30:54 -07:00
|
|
|
async fn get() {}
|
2019-10-06 23:14:34 +01:00
|
|
|
|
|
|
|
pub fn foo() -> impl Future + Send {
|
|
|
|
let client = Client(Box::new(true));
|
|
|
|
async move {
|
|
|
|
match client.status() {
|
|
|
|
200 => {
|
2023-06-12 16:55:36 +08:00
|
|
|
get().await;
|
2022-09-13 14:30:54 -07:00
|
|
|
}
|
2019-10-06 23:14:34 +01:00
|
|
|
_ => (),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|