this post was submitted on 04 Aug 2023
2 points (100.0% liked)
Rust
6025 readers
1 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I'm not quite sure I fully understand the question, but would implementing the
Default
trait work?Otherwise, I've used
Arbitrary
in tests before, maybe that's what you're looking for?Default could be useful here, thanks!
Oh wow, default is so nice. I wasn't exactly looking for this when I asked the question, but I'm glad you tipped me off to it.