Proposal: BufMap.set() returns the copied value #8533
Labels
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
standard library
This issue involves writing Zig code for the standard library.
Milestone
Currently
BufMap.set(key, value)
copies the value and stores it, but it only returns errors. BufMap is probably being used becausevalue
won't live long and a copy is desired for further processing. So now you might need to do this:If set would return the copy one could do this instead:
BTW I've just started using Zig last week so I could certainly be missing something in how this is supposed to be used.
The text was updated successfully, but these errors were encountered: