Conversation
533fe8e to
da0e08a
Compare
|
Thanks for looking at this!
The doctests can use |
|
As part of that, I think (I'm not 100% convinced of this yet, it's just more ergonomic) |
|
It's not really the /// assert_eq!(matches.free()[end_pos], "arg2");
^^^^^^^^^^^^^^^ indexing into temporary Vec//! matches.free()[0].clone()
^^^^^^^^^^^^^^^^^ here tooIt feels really dirty to do the full allocation when the documentation demonstrates mostly individual argument access. Maybe it should utilized an iterator instead (but when to panic then)? |
Sketched with the interface as proposed here: #97 (comment) except that I made
free()aResult<Vec<_>, Fail>. Since the argument processing would usually return an error before in the constructor and we no longer have that verification, a panic might be surprising to callers that had previously relied on that.In my opinion the necessary doctest changes suggest this is not super ergonomic yet. I've not yet added a lot of documentation to the methods in case the interface still needs changes.
Additionally it seems odd to treat
Valand free arguments differently but that might be a tradeoff worth making. Your call.