2019-10-06 22:14:34 +00:00
|
|
|
// edition:2018
|
2023-05-07 18:38:52 +00:00
|
|
|
// check-pass
|
2022-10-01 10:19:31 +00:00
|
|
|
|
2019-10-06 22:14:34 +00: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 21:30:54 +00:00
|
|
|
async fn get() {}
|
2019-10-06 22:14:34 +00:00
|
|
|
|
|
|
|
pub fn foo() -> impl Future + Send {
|
|
|
|
let client = Client(Box::new(true));
|
|
|
|
async move {
|
|
|
|
match client.status() {
|
|
|
|
200 => {
|
2023-06-12 08:55:36 +00:00
|
|
|
get().await;
|
2022-09-13 21:30:54 +00:00
|
|
|
}
|
2019-10-06 22:14:34 +00:00
|
|
|
_ => (),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|