Update tests based on feedback
This commit is contained in:
parent
8a0ebca97e
commit
11b1439380
10 changed files with 48 additions and 33 deletions
|
@ -6,12 +6,27 @@
|
|||
|
||||
trait MyTrait {
|
||||
async fn foo(&self) -> i32;
|
||||
async fn bar(&self) -> i32;
|
||||
}
|
||||
|
||||
impl MyTrait for i32 {
|
||||
async fn foo(&self) -> i32 {
|
||||
*self
|
||||
}
|
||||
|
||||
async fn bar(&self) -> i32 {
|
||||
self.foo().await
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
fn main() {
|
||||
let x = 5;
|
||||
// Calling from non-async context
|
||||
let _ = x.foo();
|
||||
let _ = x.bar();
|
||||
// Calling from async block in non-async context
|
||||
async {
|
||||
let _ = x.foo();
|
||||
let _ = x.bar();
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue