mirror of https://github.com/sunface/rust-course
13 lines
218 B
13 lines
218 B
3 years ago
|
## #[derive(Default)]
|
||
|
```rust
|
||
|
#[derive(Default)]
|
||
|
struct NotSend(Rc<()>);
|
||
|
|
||
|
fn require_send(_: impl Send) {}
|
||
|
|
||
|
async fn bar() {}
|
||
|
async fn foo() {
|
||
|
//Returns the "default value" for a type.
|
||
|
NotSend::default();
|
||
|
}
|
||
|
```
|