Skip to content

0.5.0

Choose a tag to compare

@VoidStarKat VoidStarKat released this 12 Oct 23:48
5d5259d

Changed

  • 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::MissingNulTerminator
    • FromUtf32Error => error::FromUtf32Error
    • NulError => error::ContainsNul
    • UCStr::from_ptr_with_nul => from_ptr_unchecked
    • UCStr::from_slice_with_nul => from_slice_truncate
    • UCStr::from_slice_with_nul_unchecked => from_slice_unchecked
    • U32CStr::from_char_ptr_with_nul => from_char_ptr_unchecked
    • U32CStr::from_char_slice_with_nul => from_char_slice_truncate
    • U32CStr::from_char_slice_with_nul_unchecked => from_char_slice_unchecked
    • UCString::new => from_vec
    • UCString::from_vec_with_nul => from_vec_truncate
    • UCString::from_ustr_with_nul => from_ustr_truncate
    • UCString::from_ptr_with_nul => from_ptr_truncate
    • UCString::from_str_with_nul => from_str_truncate
    • UCString::from_os_str_with_nul => from_os_str_truncate
    • U32CString::from_chars_with_nul => from_chars_truncate
    • U32CString::from_char_ptr_with_nul => from_char_ptr_truncate
  • Deprecated error types in the crate root. Use the errors directly from error module instead.
  • Improved implementations in some areas to reduce unncessary double allocations.
  • Improved Debug implementations. No more debugging lists of raw integer values.
  • Migrated crate to Rust 2018 edition.
  • Minimum supported Rust version is now 1.48.
  • Made crate package REUSE compliant.
  • Improved documentation and used intra-doc links.

Added

  • Added crate-level functions decode_utf16, decode_utf16_lossy, decode_utf32, and decode_utf32_lossy and associated iterators. Note that decode_utf16 is an alias of core::char::decode_utf16, but provided for consistency.
  • Added display method to to both UStr and UCStr to display strings in formatting without heap allocations, similar to Path::display. Fixes #20.
  • Added more trait implementations, including more index operations and string formatting via Write trait. Fixes #19.
  • Added new functions:
    • UStr::from_ptr_mut
    • UStr::from_slice_mut
    • UStr::as_mut_slice
    • UStr::as_mut_ptr
    • UStr::as_ptr_range
    • UStr::as_mut_ptr_range
    • UStr::get
    • UStr::get_mut
    • UStr::get_unchecked
    • UStr::get_unchecked_mut
    • UStr::split_at
    • UStr::split_at_mut
    • UStr::chars
    • UStr::chars_lossy
    • U16Str::char_indices
    • U16Str::char_indices_lossy
    • U32Str::from_char_ptr_mut
    • U32Str::from_char_slice_mut
    • UCStr::from_ptr
    • UCStr::from_ptr_truncate
    • UCStr::from_slice
    • UCStr::as_ustr
    • UCStr::from_ptr_str_mut
    • UCStr::from_ptr_mut
    • UCStr::from_ptr_truncate_mut
    • UCStr::from_ptr_unchecked_mut
    • UCStr::from_slice_mut
    • UCStr::from_slice_truncate_mut
    • UCStr::from_slice_unchecked_mut
    • UCStr::as_mut_slice
    • UCStr::as_mut_ptr
    • UCStr::as_ustr_with_nul
    • UCStr::as_mut_ustr
    • UCStr::as_ptr_range
    • UCStr::as_mut_ptr_range
    • UCStr::chars
    • UCStr::chars_lossy
    • U16CStr::char_indices
    • U16CStr::char_indices_lossy
    • U32CStr::from_char_ptr_str_mut
    • U32CStr::from_char_ptr_mut
    • U32CStr::from_char_ptr_truncate_mut
    • U32CStr::from_char_ptr_unchecked_mut
    • U32CStr::from_char_slice_mut
    • U32CStr::from_char_slice_truncate_mut
    • U32CStr::from_char_slice_unchecked_mut
    • U32CStr::from_char_ptr
    • U32CStr::from_char_ptr_truncate
    • U32CStr::from_char_slice
    • UString::as_vec
    • UString::as_mut_vec
    • UString::push_char
    • UString::truncate
    • UString::pop
    • UString::remove
    • UString::insert
    • UString::insert_ustr
    • UString::split_off
    • UCString::as_mut_ucstr
    • UCString::into_ustring
    • UCString::into_ustring_with_nul
    • U32CString::from_char_ptr_str

Deprecated

  • Deprecated functions as part of simplifying to increase clarity. These will be removed entirely in a future release.
    • UCString::from_vec_with_nul_unchecked. Use from_vec_unchecked instead.
    • UCString::from_ustr_with_nul_unchecked. Use from_ustr_unchecked instead.
    • UCString::from_ptr_with_nul_unchecked. Use from_ptr_unchecked instead.
    • UCString::from_str_with_nul_unchecked. Use from_str_unchecked instead.
    • UCString::from_os_str_with_nul_unchecked. Use from_os_str_unchecked instead.
    • U32CString::from_chars_with_nul_unchecked. Use from_chars_unchecked instead.
    • U32CString::from_char_ptr_with_nul_unchecked. Use from_char_ptr_unchecked instead.