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.
357357Another downside is that we’ve duplicated some logic. To eliminate some of the
358358duplication, we might try to make default implementations for the
359359` 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
361361the 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.
363365
364366Other duplication includes the similar implementations of the ` request_review `
365367and ` approve ` methods on ` Post ` . Both methods delegate to the implementation of
You can’t perform that action at this time.
0 commit comments