bstr icon indicating copy to clipboard operation
bstr copied to clipboard

api: const fn BString::new

Open lopopolo opened this issue 5 years ago • 1 comments
trafficstars

I'm using BString to implement an output capture struct and leverage the BString debug impl.

I'm currently adding const to as many zero argument new constructors in my code as I can. Since BString is a thin wrapper around Vec, I expected to have an analogous pub const fn new() method available.

There is no workaround for this since Into::into is not const.

lopopolo avatar Aug 18 '20 03:08 lopopolo

I think this can probably happen in bstr 1.0. It is mostly a matter of MSRV. But I'm in favor of such things in principle. Although it seems more like a mild nicety at this point to me.

BurntSushi avatar Aug 18 '20 03:08 BurntSushi