ch20-02-mutlithreaded.md listing 20-21 deleting 'dyn' for call_box

This commit is contained in:
Yasushi Sakai
2018-08-04 12:02:56 -04:00
parent 88cdde350f
commit 31435f78ef

View File

@@ -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)()
}
}