mirror of
https://github.com/rust-lang/book.git
synced 2026-05-18 06:43:34 -04:00
ch20-02-mutlithreaded.md listing 20-21 deleting 'dyn' for call_box
This commit is contained in:
@@ -1020,11 +1020,11 @@ shown in Listing 20-21.
|
||||
|
||||
```rust,ignore
|
||||
trait FnBox {
|
||||
fn call_box(self: Box<dyn Self>);
|
||||
fn call_box(self: Box<Self>);
|
||||
}
|
||||
|
||||
impl<F: FnOnce()> FnBox for F {
|
||||
fn call_box(self: Box<dyn F>) {
|
||||
fn call_box(self: Box<F>) {
|
||||
(*self)()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user