]> git.lizzy.rs Git - rust.git/commit
Default methods example: Show "(in)valid" case
authorLeif Arne Storset <leifarne@storset.net>
Sat, 25 Jul 2015 16:18:47 +0000 (18:18 +0200)
committerLeif Arne Storset <leifarne@storset.net>
Sat, 25 Jul 2015 18:53:57 +0000 (20:53 +0200)
commit7bec320e6e067b9886f66f8c5d75e4bfef633f52
tree85322e33c42e11143bfa089cb83f59e96dcf2899
parent04badd6a973d2499731b49365a121dbc4c9c468e
Default methods example: Show "(in)valid" case

Instead of bar/baz, use valid/invalid as default methods. This
illustrates why you might want default methods, and shows that you can
call other trait methods from a default method.
src/doc/trpl/traits.md