1.0.0-beta.1
Pre-release
Pre-release
Changed
- Breaking Change Minimum supported Rust version is now 1.56.
- Breaking Change The following methods on
U16String
andU32String
have been renamed and replaced by functions with different semantics:pop
is nowpop_char
remove
is nowremove_char
insert
is nowinsert_char
- Breaking Change Moved and renamed the following iterator types:
iter::Utf16Chars
renamed toCharsUtf16
and moved toustr
anducstr
iter::Utf32Chars
renamed toCharsUtf32
and moved toustr
anducstr
iter::CharsLossy
split and renamed toCharsLossyUtf16
andCharsLossyUtf32
and moved toustr
anducstr
iter::Utf16CharIndices
renamed toCharIndicesUtf16
and moved toustr
anducstr
iter::Utf16CharIndicesLossy
renamed toCharIndicesLossyUtf16
and moved toustr
anducstr
- Breaking Change
error::FromUtf16Error
anderror::FromUtf32Error
has been renamed toUtf16Error
andUtf32Error
respectively and expanded with more details about the error. - Migrated crate to Rust 2021 edition.
- The following methods on
U16Str
andU32Str
are nowconst
:from_slice
as_slice
as_ptr
len
is_empty
- The following methods on
U16CStr
andU32CStr
are nowconst
:from_slice_unchecked
as_slice_with_nul
as_ptr
len
is_empty
- The following methods on
U16String
andU32String
are nowconst
:new
Added
- Added new UTF-encoded string types and associated types:
Utf16Str
Utf32Str
Utf16String
Utf32String
- Added macros to convert string literals into
const
wide string slices:u16str!
u16cstr!
u32str!
u32cstr!
widestr!
widecstr!
utf16str!
utf32str!
- Added
NUL_TERMINATOR
associated constant toU16CStr
,U32CStr
,U16CString
, andU32CString
. - Added
DoubleEndedIterator
andExactSizeIterator
implementations to a number of iterator types. - Added new UTF encoding functions alongside existing decode functions:
encode_utf8
encode_utf16
encode_utf32
- Added various methods:
repeat
onU16Str
,U32Str
,U16CStr
, andU32CStr
shrink_to
onU16String
andU32String
retain
onU16String
andU32String
drain
onU16String
andU32String
replace_range
onU16String
andU32String
get
,get_mut
,get_unchecked
, andget_unchecked_mut
onU16CStr
andU32CStr
split_at
andsplit_at_mut
onU16CStr
andU32CStr
- 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
U16Str
instead ofUStr<u16>
).UChar
UStr
UCStr
UString
UCString
- Breaking Change Removed
IndexMut<RangeFull>
trait implementation ofU16CString
andU32CString
. Use the unsafeget_mut
method instead, which also supports more ranges.
Fixed
- Breaking Change The iterator returned by
U16Str::char_indices
andU16CStr::char_indices
is 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_lossy
andU16CStr::char_indices_lossy
. This matches what was stated in original documentation. U32Str::to_string
andU32CStr::to_string
now only allocate once instead of twice.