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 tag marks the 1.0 release of bstr, a byte string library for Rust. The 1.0
release is a significant milestone, and I expect bstr to remain at 1.0 for the
foreseeable future. This means it is now appropriate to use it in the public
APIs of your own crate, if desired.
The following is a list of breaking changes from the `0.2` release. In
general, all changes are pretty minor.
I encourage anyone to ask questions using GitHub Discussions:
https://github.com/BurntSushi/bstr/discussions
* `Bytes::as_slice` is renamed to `Bytes::as_bytes`.
* `ByteVec::into_os_string` now returns `Result<OsString, FromUtf8Error>`
instead of `Result<OsString, Vec<u8>>`.
* `ByteVec::into_path_buf` now returns `Result<PathBuf, FromUtf8Error>` instead
of `Result<PathBuf, Vec<u8>>`.
* `Find<'a>` has been changed to `Find<'h, 'n>`, which represents the lifetimes
of both the haystack and the needle, instead of the shorter of the two.
* `FindReverse<'a>` has been changed to `FindReverse<'h, 'n>`, which represents
the lifetimes of both the haystack and the needle, instead of the shorter of
the two.
* `Split<'a>` has been changed to `Split<h, 's>`, which represents the
lifetimes of both the haystack and the splitter, instead of the shorter of the
two.
* `SplitReverse<'a>` has been changed to `SplitReverse<'h, 's>`, which
represents the lifetimes of both the haystack and the splitter, instead of the
shorter of the two.
* `SplitN<'a>` has been changed to `SplitN<h, 's>`, which represents the
lifetimes of both the haystack and the splitter, instead of the shorter of the
two.
* `SplitNReverse<'a>` has been changed to `SplitNReverse<h, 's>`, which
represents the lifetimes of both the haystack and the splitter, instead of the
shorter of the two.
* `ByteSlice::fields` is now gated behind the `unicode` feature. Previously, it
was available unconditionally.
* `serde1` has been renamed to `serde1-std`, and `serde1-nostd` has been split
into `serde1-alloc` and `serde1-core`.
* `BufReadExt::for_byte_line` now accepts `&mut self` instead of `self`.
* `BufReadExt::for_byte_record` now accepts `&mut self` instead of `self`.
* `BufReadExt::for_byte_line_with_terminator` now accepts `&mut self` instead
of `self`.
* `BufReadExt::for_byte_record_with_terminator` now accepts `&mut self` instead
of `self`.
* The `OsStr` and `Path` conversion routines had their API docs tweaked
slightly so that they could defer to a possible `OsStr::as_bytes` (and
`OsStr::from_bytes`) routine in the future, if it's added. But their behavior
otherwise currently remains the same.
* The `serde1-*` features have been dropped. `bstr` now just has a `serde`
feature and uses the new `dep:` and `pkg?` syntax so that it will combine as
one would expect with other features.
* `ByteSlice::copy_within_str` has been removed, since `slice::copy_within` has
been stable since Rust 1.37. `slice::copy_within` does the exact same thing.