Skip to content

Glossary: Software Design Patterns in Rust

Default-method surprise

Rust's version of the fragile base class: changing a trait's default method affects only the types that didn't copy or override it. Adding tax to the default `total` would tax only Retail.

Where the book teaches it

Related terms

Fragile base classDefault method