1.0.0-beta.1
Pre-release
Pre-release
·
85 commits
to main
since this release
Changed
- Breaking Change Minimum supported Rust version is now 1.56.
- Breaking Change The following methods on
U16StringandU32Stringhave been renamed and replaced by functions with different semantics:popis nowpop_charremoveis nowremove_charinsertis nowinsert_char
- Breaking Change Moved and renamed the following iterator types:
iter::Utf16Charsrenamed toCharsUtf16and moved toustranducstriter::Utf32Charsrenamed toCharsUtf32and moved toustranducstriter::CharsLossysplit and renamed toCharsLossyUtf16andCharsLossyUtf32and moved toustranducstriter::Utf16CharIndicesrenamed toCharIndicesUtf16and moved toustranducstriter::Utf16CharIndicesLossyrenamed toCharIndicesLossyUtf16and moved toustranducstr
- Breaking Change
error::FromUtf16Erroranderror::FromUtf32Errorhas been renamed toUtf16ErrorandUtf32Errorrespectively and expanded with more details about the error. - Migrated crate to Rust 2021 edition.
- The following methods on
U16StrandU32Strare nowconst:from_sliceas_sliceas_ptrlenis_empty
- The following methods on
U16CStrandU32CStrare nowconst:from_slice_uncheckedas_slice_with_nulas_ptrlenis_empty
- The following methods on
U16StringandU32Stringare nowconst:new
Added
- Added new UTF-encoded string types and associated types:
Utf16StrUtf32StrUtf16StringUtf32String
- Added macros to convert string literals into
constwide string slices:u16str!u16cstr!u32str!u32cstr!widestr!widecstr!utf16str!utf32str!
- Added
NUL_TERMINATORassociated constant toU16CStr,U32CStr,U16CString, andU32CString. - Added
DoubleEndedIteratorandExactSizeIteratorimplementations to a number of iterator types. - Added new UTF encoding functions alongside existing decode functions:
encode_utf8encode_utf16encode_utf32
- Added various methods:
repeatonU16Str,U32Str,U16CStr, andU32CStrshrink_toonU16StringandU32StringretainonU16StringandU32StringdrainonU16StringandU32Stringreplace_rangeonU16StringandU32Stringget,get_mut,get_unchecked, andget_unchecked_mutonU16CStrandU32CStrsplit_atandsplit_at_mutonU16CStrandU32CStr
- Added more trait implementations.
Removed
- Breaking Change Functions and types deprecated in 0.5 have been removed.
- Breaking Change The following types and traits, which were implementation details, have been removed. Use the existing non-generic types instead (e.g. use
U16Strinstead ofUStr<u16>).UCharUStrUCStrUStringUCString
- Breaking Change Removed
IndexMut<RangeFull>trait implementation ofU16CStringandU32CString. Use the unsafeget_mutmethod instead, which also supports more ranges.
Fixed
- Breaking Change The iterator returned by
U16Str::char_indicesandU16CStr::char_indicesis now over(usize, Result<char, DecodeUtf16Error>)tuples instead of the reverse order, to better match standard library string iterators. The same is true ofU16Str::char_indices_lossyandU16CStr::char_indices_lossy. This matches what was stated in original documentation. U32Str::to_stringandU32CStr::to_stringnow only allocate once instead of twice.