File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -357,9 +357,11 @@ another design pattern.
357
357
Another downside is that we’ve duplicated some logic. To eliminate some of the
358
358
duplication, we might try to make default implementations for the
359
359
` request_review ` and ` approve ` methods on the ` State ` trait that return ` self ` ;
360
- however, this would violate object safety , because the trait doesn’t know what
360
+ however, this would violate dyn compatibility , because the trait doesn’t know what
361
361
the concrete ` self ` will be exactly. We want to be able to use ` State ` as a
362
- trait object, so we need its methods to be object safe.
362
+ trait object, so we need its methods to be compatible with trait objects–this is
363
+ known as dyn compatible. In older documentation, this concept is often referred to
364
+ as object safety.
363
365
364
366
Other duplication includes the similar implementations of the ` request_review `
365
367
and ` approve ` methods on ` Post ` . Both methods delegate to the implementation of
You can’t perform that action at this time.
0 commit comments