16 KiB
16 KiB
Changelog
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Unreleased
1.0.2 - 2022-07-15
Fixed
- Correctly check for and error on nul values in C-string macros
u16cstr!,u32cstr!, andwidecstr!. Fixes #28.
1.0.1 - 2022-06-24
Fixed
- Reduce collision potential for macros. By @OpenByteDev.
1.0.0 - 2022-06-21
Changed
- Breaking Change Minimum supported Rust version is now 1.58.
- Added
#[must_use]attributes to many crate functions, as appropriate. - Remove
unsafequalifiers fromas_mut_ptrandas_mut_ptr_rangeto match standard library. By @yescallop.
Added
- Added
newfunction that creates and empty string toU16CStringandU32CStringto match other string types. - Additional
Fromimplementations for conversion toOsString.
1.0.0-beta.1 - 2021-11-08
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.
0.5.1 - 2021-10-23
Fixed
- Fixed a regression in 0.5.0 where zero-length vectors and strings were incorrectly causing panics
in
UCString::from_vecandUCString::from_str. Fixes #22. - Modified an implentation detail in
ustr::to_string&ustr::to_string_lossyto remove possibly unsafe behaviour.
0.5.0 - 2021-10-12
Changed
- Breaking Change Minimum supported Rust version is now 1.48.
- Breaking Change Renamed a number of types and functions to increase consistency and clarity.
This also meant renaming errors to more clearly convey error and trying to be more consistent with
name conventions and functionality across types. Check renamed function docs for any changes in
functionality, as there have been some minor tweaks (mostly relaxing/removing error conditions and
reducing panics). Old names have been deprecated to ease transition and will be removed in a
future release. Fixes #18.
MissingNulError=>error::MissingNulTerminatorFromUtf32Error=>error::FromUtf32ErrorNulError=>error::ContainsNulUCStr::from_ptr_with_nul=>from_ptr_uncheckedUCStr::from_slice_with_nul=>from_slice_truncateUCStr::from_slice_with_nul_unchecked=>from_slice_uncheckedU32CStr::from_char_ptr_with_nul=>from_char_ptr_uncheckedU32CStr::from_char_slice_with_nul=>from_char_slice_truncateU32CStr::from_char_slice_with_nul_unchecked=>from_char_slice_uncheckedUCString::new=>from_vecUCString::from_vec_with_nul=>from_vec_truncateUCString::from_ustr_with_nul=>from_ustr_truncateUCString::from_ptr_with_nul=>from_ptr_truncateUCString::from_str_with_nul=>from_str_truncateUCString::from_os_str_with_nul=>from_os_str_truncateU32CString::from_chars_with_nul=>from_chars_truncateU32CString::from_char_ptr_with_nul=>from_char_ptr_truncate
- Improved implementations in some areas to reduce unncessary double allocations.
- Improved
Debugimplementations. No more debugging lists of raw integer values. - Migrated crate to Rust 2018 edition.
- Made crate package REUSE compliant.
- Improved documentation and used intra-doc links.
Added
- Added crate-level functions
decode_utf16,decode_utf16_lossy,decode_utf32, anddecode_utf32_lossyand associated iterators. Note thatdecode_utf16is an alias ofcore::char::decode_utf16, but provided for consistency. - Added
displaymethod to to bothUStrandUCStrto display strings in formatting without heap allocations, similar toPath::display. Fixes #20. - Added more trait implementations, including more index operations and string formatting via
Writetrait. Fixes #19. - Added new functions:
UStr::from_ptr_mutUStr::from_slice_mutUStr::as_mut_sliceUStr::as_mut_ptrUStr::as_ptr_rangeUStr::as_mut_ptr_rangeUStr::getUStr::get_mutUStr::get_uncheckedUStr::get_unchecked_mutUStr::split_atUStr::split_at_mutUStr::charsUStr::chars_lossyU16Str::char_indicesU16Str::char_indices_lossyU32Str::from_char_ptr_mutU32Str::from_char_slice_mutUCStr::from_ptrUCStr::from_ptr_truncateUCStr::from_sliceUCStr::as_ustrUCStr::from_ptr_str_mutUCStr::from_ptr_mutUCStr::from_ptr_truncate_mutUCStr::from_ptr_unchecked_mutUCStr::from_slice_mutUCStr::from_slice_truncate_mutUCStr::from_slice_unchecked_mutUCStr::as_mut_sliceUCStr::as_mut_ptrUCStr::as_ustr_with_nulUCStr::as_mut_ustrUCStr::as_ptr_rangeUCStr::as_mut_ptr_rangeUCStr::charsUCStr::chars_lossyU16CStr::char_indicesU16CStr::char_indices_lossyU32CStr::from_char_ptr_str_mutU32CStr::from_char_ptr_mutU32CStr::from_char_ptr_truncate_mutU32CStr::from_char_ptr_unchecked_mutU32CStr::from_char_slice_mutU32CStr::from_char_slice_truncate_mutU32CStr::from_char_slice_unchecked_mutU32CStr::from_char_ptrU32CStr::from_char_ptr_truncateU32CStr::from_char_sliceUString::as_vecUString::as_mut_vecUString::push_charUString::truncateUString::popUString::removeUString::insertUString::insert_ustrUString::split_offUCString::as_mut_ucstrUCString::into_ustringUCString::into_ustring_with_nulU32CString::from_char_ptr_str
Deprecated
- Deprecated functions as part of simplifying to increase clarity. These will be removed entirely
in a future release.
MissingNulError. Useerror::MissingNulTerminatorinstead.FromUtf32Error. Useerror::FromUtf32Errorinstead.NulError. Useerror::ContainsNulinstead.UCStr::from_ptr_with_nul. Usefrom_ptr_uncheckedinstead.UCStr::from_slice_with_nul. Usefrom_slice_truncateinstead.UCStr::from_slice_with_nul_unchecked. Usefrom_slice_uncheckedinstead.U32CStr::from_char_ptr_with_nul. Usefrom_char_ptr_uncheckedinstead.U32CStr::from_char_slice_with_nul. Usefrom_char_slice_truncateinstead.U32CStr::from_char_slice_with_nul_unchecked. Usefrom_char_slice_uncheckedinstead.UCString::new. Usefrom_vecinstead.UCString::from_vec_with_nul_unchecked. Usefrom_vec_uncheckedinstead.UCString::from_ustr_with_nul_unchecked. Usefrom_ustr_uncheckedinstead.UCString::from_ptr_with_nul_unchecked. Usefrom_ptr_uncheckedinstead.UCString::from_str_with_nul_unchecked. Usefrom_str_uncheckedinstead.UCString::from_os_str_with_nul_unchecked. Usefrom_os_str_uncheckedinstead.UCString::from_vec_with_nul. Usefrom_vec_truncateinstead.UCString::from_ustr_with_nul. Usefrom_ustr_truncateinstead.UCString::from_ptr_with_nul. Usefrom_ptr_truncateinstead.UCString::from_str_with_nul. Usefrom_str_truncateinstead.UCString::from_os_str_with_nul. Usefrom_os_str_truncateinstead.U32CString::from_chars_with_nul_unchecked. Usefrom_chars_uncheckedinstead.U32CString::from_char_ptr_with_nul_unchecked. Usefrom_char_ptr_uncheckedinstead.U32CString::from_chars_with_nul. Usefrom_chars_truncateinstead.U32CString::from_char_ptr_with_nul. Usefrom_char_ptr_truncateinstead.
- Deprecated error types in the crate root. Use the errors directly from
errormodule instead.
0.4.3 - 2020-10-05
Fixed
- Fixed undefined behaviours and cleaned up clippy warnings. By @joshwd36.
0.4.2 - 2020-06-09
Fixed
- Fixed compile errors on pre-1.36.0 Rust due to unstable
alloccrate. Minimum supported version is Rust 1.34.2, the rust version for Debian stable. Fixes #14.
0.4.1 - 2020-06-08
Yanked
Changed
- Now supports
no_std. Added thestdandallocfeatures, enabled by default.U16String,U32String,U16CString, andU32CStringand their aliases all require theallocorstdfeature. By @nicbn.
0.4.0 - 2018-08-18
Added
- New
U32String,U32Str,U32CString, andU32CStrtypes for dealing with UTF-32 FFI. These new types are roughly equivalent to the existing UTF-16 types. WideCharis a type alias tou16on Windows butu32on non-Windows platforms.- The generic types
UString,UStr,UCStringandUCStrare used to implement the string types.
Changed
- Breaking Change Existing wide string types have been renamed to
U16String,U16Str,U16CString, andU16CStr(previouslyWideString,WideStr, etc.). Some function have also been renamed to reflect this change (wide_strtou16_str, etc.). - Breaking Change
WideString,WideStr,WideCString, andWideCStrare now type aliases that vary between platforms. On Windows, these are aliases to theU16types and are equivalent to the previous version, but on non-Windows platforms these alias the newU32types instead. See crate documentation for more details.
0.3.0 - 2018-03-17
Added
- Additional unchecked functions on
WideCString. - All types now implement
Default. WideString::shrink_to_fitWideString::into_boxed_wide_strandBox<WideStr>::into_wide_string.WideCString::into_boxed_wide_c_strandBox<WideCStr>::into_wide_c_string.FromandDefaultimplementations for boxedWideStrand boxedWideCStr.
Changed
- Renamed
WideCString::from_vecto replaceWideCString::new. To create empty string, useWideCString::default()now. WideCStringnow implementsDrop, which sets the string to an empty string to prevent invalid unsafe code from working correctly when it should otherwise break. Also seeDropimplementation ofCString.- Writing changelog manually.
- Upgraded winapi dev dependency.
- Now requires at least Rust 1.17+ to compile (previously, was Rust 1.8).
0.2.2 - 2016-09-09
Fixed
- Make
WideCString::into_rawcorrectly forget the original self.
0.2.1 - 2016-08-12
Added
into_raw/from_rawonWideCString. Closes #2.
0.2.0 - 2016-05-31
Added
Defaulttrait to wide strings.- Traits for conversion of strings to
Cow.
Changed
- Methods & traits to bring to parity with Rust 1.9 string APIs.
0.1.0 - 2016-02-06
Added
- Initial release.