You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue was spun off from this comment which states problems with creating instances of &BStr if type-inference bails out. The latter is typical within Cow and as one side of assert_eq!().
The intuitive way of doing this to me was BStr::new("") or BStr::new("hello") or BStr::new(b"hi"), similar to what's possible with std::path::Path::new(…).
The text was updated successfully, but these errors were encountered:
This adds a convenience constructor for building a BStr slice directly
from anything that impls AsRef<[u8]>. This is analogous to, e.g.,
Path::new from std.
While this constructor is redundant, it is often convenient because of
its concreteness. Alternatives rely on generics via trait impls, which
don't always work seamlessly.
Closes#110
This issue was spun off from this comment which states problems with creating instances of
&BStr
if type-inference bails out. The latter is typical withinCow
and as one side ofassert_eq!()
.The intuitive way of doing this to me was
BStr::new("")
orBStr::new("hello")
orBStr::new(b"hi")
, similar to what's possible withstd::path::Path::new(…)
.The text was updated successfully, but these errors were encountered: