-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: apply where statement to impls instead of fns (#7433)
Now that we can have a `where` that [affects an entire `impl`](noir-lang/noir#4508), I thought I'd give this a try in the state variables. Often I've felt tricked by these implementations, since when trying to work with them the requirements for a given generic `T` seem fairly low, but then they add up as I start calling more and more functions, which each add their own trait bounds. The interface ends up feeling dishonest and not really showing all you need to do (all the traits that must be implemented) in order to be able to use the thing. With this change, the entire impl now requests up front all trait bounds, though it does mean we're a bit more restrictive than strictly needed. I don't think this is an issue - yes, you don't need to be able to serialize in order to read a public mutable, but you can only read if you write before, and that requires serialization. So all in all it seems like we always end up indirectly requiring all traits. --------- Co-authored-by: benesjan <janbenes1234@gmail.com>
- Loading branch information
Showing
7 changed files
with
48 additions
and
57 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
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
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
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
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
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
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