The sound distributed version control system

#171 Add 'Default' implementations

Closed on December 7, 2020
danieleades on December 5, 2020

There are a lot of cases in this library where there are ‘new’ methods which take no parameters. This is the domain of the standard library trait ‘Default’

benefits of adding ‘Default’ implementations

  • you can use standard library helper functions (eg. unwrap_or_default())
  • it’s often derivable (as is the case with a number of structs in this library!)
  • you can derive Default on other structs which contain types that have ‘Default’ implementations

you can add a transparent ‘new()’ method which delegates to the default method if you wish to continue to have that method available

danieleades added a change on December 5, 2020
pmeunier on December 7, 2020

Done, thanks!

pmeunier closed this discussion on December 7, 2020