-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make InexactObject(Vec<Prop>) and ExactObject(Vec<Prop>) objects with…
… private constructors Summary: * Add some type safety - wrap Vec<Prop> in two newtypes, InexactObject and ExactObject * These structs have a single private field. This allows us to force developers to use a constructor (InexactObject::new), which (in a followup diff) will sort the props. However, they implement Deref and DerefMut, so we conversion **out** is not a problem. (We never need to consume them, so From is not necessary.) Thanks Maarten Staa! Reviewed By: captbaritone Differential Revision: D34468586 fbshipit-source-id: e39822d3289af25f6c658649bc2499f84aa0c7b3
- Loading branch information
1 parent
a844636
commit 8beb0cb
Showing
4 changed files
with
142 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.