Debian Codegraph @

CHANGELOG.md

raw symbols SCIP
1 # Changelog
2
3 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
4 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
6 ## [Unreleased]
7
8 ## [1.2.1] - 2025-10-08 <a name="1.2.1"></a>
9 ### Changed
10 - Git repository URL has changed due to GitHub user name change. Old URL is redirected.
11
12 ### Fixed
13 - `trim_end` character boundary panic when processing 4-byte characters. By [@syrflover].
14 - Fixed completely broken `U16String::insert_char` which always panicked. Fixes [#46].
15 - Documentation typos on `WideCString` type alias.
16 - Fixed `unused_import` lint on `wide*` macros.
17
18 ### Added
19 - Added GDB pretty printers for `Utf32String` and `Utf32Str`. You can load them from `gdb/widestring.py`.
20
21 ## [1.2.0] - 2024-03-15 <a name="1.2.0"></a>
22 ### Changed
23 - Minor restructing of included license file locations to be more consistent with crates ecosystem.
24 - Moved to `windows-sys` for documentation tests instead of legacy `winapi` crate. Fixes [#40].
25
26 ### Added
27 - Added `.lines()` method on various string slices. Fixes [#33]. By [@mr-adult].
28
29 ### Fixed
30 - Removed panic in `Utf16String::truncate` when `new_len` greater than string length. Fixes [#39].
31 - Fixed various clippy warnings.
32 - Fixed debugger visualizer for Rust 1.82+ due to changes in `core` library structures.
33
34 ## [1.1.0] - 2022-04-06 <a name="1.1.0"></a>
35 ### Added
36 - `Utf32String::into_char_vec` and missing conversion to `Vec<char>` for `Utf32String`. Fixes [#37].
37 - `include_utf16str!` macro to include UTF-16 file at compile-time as `Utf16Str`. By [@daxpedda].
38
39 ### Fixed
40 - `U16String::pop_char` panics with surrogate string. Fixes [#38].
41 - Various import warnings and new clippy warnings, plus stabilized debugger visualizer warnings.
42
43 ## [1.0.2] - 2022-07-15 <a name="1.0.2"></a>
44 ### Fixed
45 - Correctly check for and error on nul values in C-string macros `u16cstr!`, `u32cstr!`, and
46 `widecstr!`. Fixes [#28].
47
48 ## [1.0.1] - 2022-06-24 <a name="1.0.1"></a>
49 ### Fixed
50 - Reduce collision potential for macros. By [@OpenByteDev].
51
52 ## [1.0.0] - 2022-06-21 <a name="1.0.0"></a>
53 ### Changed
54 - **Breaking Change** Minimum supported Rust version is now 1.58.
55 - Added `#[must_use]` attributes to many crate functions, as appropriate.
56 - Remove `unsafe` qualifiers from `as_mut_ptr` and `as_mut_ptr_range` to match standard library. By
57 [@yescallop].
58
59 ### Added
60 - Added `new` function that creates and empty string to `U16CString` and `U32CString` to match other
61 string types.
62 - Additional `From` implementations for conversion to `OsString`.
63
64 ## [1.0.0-beta.1] - 2021-11-08 <a name="1.0.0-beta.1"></a>
65 ### Changed
66 - **Breaking Change** Minimum supported Rust version is now 1.56.
67 - **Breaking Change** The following methods on `U16String` and `U32String` have been renamed and
68 replaced by functions with different semantics:
69 - `pop` is now `pop_char`
70 - `remove` is now `remove_char`
71 - `insert` is now `insert_char`
72 - **Breaking Change** Moved and renamed the following iterator types:
73 - `iter::Utf16Chars` renamed to `CharsUtf16` and moved to `ustr` and `ucstr`
74 - `iter::Utf32Chars` renamed to `CharsUtf32` and moved to `ustr` and `ucstr`
75 - `iter::CharsLossy` split and renamed to `CharsLossyUtf16` and `CharsLossyUtf32` and moved to
76 `ustr` and `ucstr`
77 - `iter::Utf16CharIndices` renamed to `CharIndicesUtf16` and moved to `ustr` and `ucstr`
78 - `iter::Utf16CharIndicesLossy` renamed to `CharIndicesLossyUtf16` and moved to `ustr` and `ucstr`
79 - **Breaking Change** `error::FromUtf16Error` and `error::FromUtf32Error` has been renamed to
80 `Utf16Error` and `Utf32Error` respectively and expanded with more details about the error.
81 - Migrated crate to Rust 2021 edition.
82 - The following methods on `U16Str` and `U32Str` are now `const`:
83 - `from_slice`
84 - `as_slice`
85 - `as_ptr`
86 - `len`
87 - `is_empty`
88 - The following methods on `U16CStr` and `U32CStr` are now `const`:
89 - `from_slice_unchecked`
90 - `as_slice_with_nul`
91 - `as_ptr`
92 - `len`
93 - `is_empty`
94 - The following methods on `U16String` and `U32String` are now `const`:
95 - `new`
96
97 ### Added
98 - Added new UTF-encoded string types and associated types:
99 - `Utf16Str`
100 - `Utf32Str`
101 - `Utf16String`
102 - `Utf32String`
103 - Added macros to convert string literals into `const` wide string slices:
104 - `u16str!`
105 - `u16cstr!`
106 - `u32str!`
107 - `u32cstr!`
108 - `widestr!`
109 - `widecstr!`
110 - `utf16str!`
111 - `utf32str!`
112 - Added `NUL_TERMINATOR` associated constant to `U16CStr`, `U32CStr`, `U16CString`, and
113 `U32CString`.
114 - Added `DoubleEndedIterator` and `ExactSizeIterator` implementations to a number of iterator types.
115 - Added new UTF encoding functions alongside existing decode functions:
116 - `encode_utf8`
117 - `encode_utf16`
118 - `encode_utf32`
119 - Added various methods:
120 - `repeat` on `U16Str`, `U32Str`, `U16CStr`, and `U32CStr`
121 - `shrink_to` on `U16String` and `U32String`
122 - `retain` on `U16String` and `U32String`
123 - `drain` on `U16String` and `U32String`
124 - `replace_range` on `U16String` and `U32String`
125 - `get`, `get_mut`, `get_unchecked`, and `get_unchecked_mut` on `U16CStr` and `U32CStr`
126 - `split_at` and `split_at_mut` on `U16CStr` and `U32CStr`
127 - Added more trait implementations.
128
129 ### Removed
130 - **Breaking Change** Functions and types deprecated in 0.5 have been removed.
131 - **Breaking Change** The following types and traits, which were implementation details, have been
132 removed. Use the existing non-generic types instead (e.g. use `U16Str` instead of `UStr<u16>`).
133 - `UChar`
134 - `UStr`
135 - `UCStr`
136 - `UString`
137 - `UCString`
138 - **Breaking Change** Removed `IndexMut<RangeFull>` trait implementation of `U16CString` and
139 `U32CString`. Use the unsafe `get_mut` method instead, which also supports more ranges.
140
141 ### Fixed
142 - **Breaking Change** The iterator returned by `U16Str::char_indices` and `U16CStr::char_indices`
143 is now over `(usize, Result<char, DecodeUtf16Error>)` tuples instead of the reverse order, to
144 better match standard library string iterators. The same is true of `U16Str::char_indices_lossy`
145 and `U16CStr::char_indices_lossy`. This matches what was stated in original documentation.
146 - `U32Str::to_string` and `U32CStr::to_string` now only allocate once instead of twice.
147
148 ## [0.5.1] - 2021-10-23 <a name="0.5.1"></a>
149 ### Fixed
150 - Fixed a regression in 0.5.0 where zero-length vectors and strings were incorrectly causing panics
151 in `UCString::from_vec` and `UCString::from_str`. Fixes [#22].
152 - Modified an implentation detail in `ustr::to_string` & `ustr::to_string_lossy` to remove possibly
153 unsafe behaviour.
154
155 ## [0.5.0] - 2021-10-12 <a name="0.5.0"></a>
156 ### Changed
157 - **Breaking Change** Minimum supported Rust version is now 1.48.
158 - **Breaking Change** Renamed a number of types and functions to increase consistency and clarity.
159 This also meant renaming errors to more clearly convey error and trying to be more consistent with
160 name conventions and functionality across types. Check renamed function docs for any changes in
161 functionality, as there have been some minor tweaks (mostly relaxing/removing error conditions and
162 reducing panics). Old names have been deprecated to ease transition and will be removed in a
163 future release. Fixes [#18].
164 - `MissingNulError` => `error::MissingNulTerminator`
165 - `FromUtf32Error` => `error::FromUtf32Error`
166 - `NulError` => `error::ContainsNul`
167 - `UCStr::from_ptr_with_nul` => `from_ptr_unchecked`
168 - `UCStr::from_slice_with_nul` => `from_slice_truncate`
169 - `UCStr::from_slice_with_nul_unchecked` => `from_slice_unchecked`
170 - `U32CStr::from_char_ptr_with_nul` => `from_char_ptr_unchecked`
171 - `U32CStr::from_char_slice_with_nul` => `from_char_slice_truncate`
172 - `U32CStr::from_char_slice_with_nul_unchecked` => `from_char_slice_unchecked`
173 - `UCString::new` => `from_vec`
174 - `UCString::from_vec_with_nul` => `from_vec_truncate`
175 - `UCString::from_ustr_with_nul` => `from_ustr_truncate`
176 - `UCString::from_ptr_with_nul` => `from_ptr_truncate`
177 - `UCString::from_str_with_nul` => `from_str_truncate`
178 - `UCString::from_os_str_with_nul` => `from_os_str_truncate`
179 - `U32CString::from_chars_with_nul` => `from_chars_truncate`
180 - `U32CString::from_char_ptr_with_nul` => `from_char_ptr_truncate`
181 - Improved implementations in some areas to reduce unncessary double allocations.
182 - Improved `Debug` implementations. No more debugging lists of raw integer values.
183 - Migrated crate to Rust 2018 edition.
184 - Made crate package [REUSE compliant](https://reuse.software/).
185 - Improved documentation and used intra-doc links.
186
187 ### Added
188 - Added crate-level functions `decode_utf16`, `decode_utf16_lossy`, `decode_utf32`, and
189 `decode_utf32_lossy` and associated iterators. Note that `decode_utf16` is an alias of
190 `core::char::decode_utf16`, but provided for consistency.
191 - Added `display` method to to both `UStr` and `UCStr` to display strings in formatting without heap
192 allocations, similar to `Path::display`. Fixes [#20].
193 - Added more trait implementations, including more index operations and string formatting via
194 `Write` trait. Fixes [#19].
195 - Added new functions:
196 - `UStr::from_ptr_mut`
197 - `UStr::from_slice_mut`
198 - `UStr::as_mut_slice`
199 - `UStr::as_mut_ptr`
200 - `UStr::as_ptr_range`
201 - `UStr::as_mut_ptr_range`
202 - `UStr::get`
203 - `UStr::get_mut`
204 - `UStr::get_unchecked`
205 - `UStr::get_unchecked_mut`
206 - `UStr::split_at`
207 - `UStr::split_at_mut`
208 - `UStr::chars`
209 - `UStr::chars_lossy`
210 - `U16Str::char_indices`
211 - `U16Str::char_indices_lossy`
212 - `U32Str::from_char_ptr_mut`
213 - `U32Str::from_char_slice_mut`
214 - `UCStr::from_ptr`
215 - `UCStr::from_ptr_truncate`
216 - `UCStr::from_slice`
217 - `UCStr::as_ustr`
218 - `UCStr::from_ptr_str_mut`
219 - `UCStr::from_ptr_mut`
220 - `UCStr::from_ptr_truncate_mut`
221 - `UCStr::from_ptr_unchecked_mut`
222 - `UCStr::from_slice_mut`
223 - `UCStr::from_slice_truncate_mut`
224 - `UCStr::from_slice_unchecked_mut`
225 - `UCStr::as_mut_slice`
226 - `UCStr::as_mut_ptr`
227 - `UCStr::as_ustr_with_nul`
228 - `UCStr::as_mut_ustr`
229 - `UCStr::as_ptr_range`
230 - `UCStr::as_mut_ptr_range`
231 - `UCStr::chars`
232 - `UCStr::chars_lossy`
233 - `U16CStr::char_indices`
234 - `U16CStr::char_indices_lossy`
235 - `U32CStr::from_char_ptr_str_mut`
236 - `U32CStr::from_char_ptr_mut`
237 - `U32CStr::from_char_ptr_truncate_mut`
238 - `U32CStr::from_char_ptr_unchecked_mut`
239 - `U32CStr::from_char_slice_mut`
240 - `U32CStr::from_char_slice_truncate_mut`
241 - `U32CStr::from_char_slice_unchecked_mut`
242 - `U32CStr::from_char_ptr`
243 - `U32CStr::from_char_ptr_truncate`
244 - `U32CStr::from_char_slice`
245 - `UString::as_vec`
246 - `UString::as_mut_vec`
247 - `UString::push_char`
248 - `UString::truncate`
249 - `UString::pop`
250 - `UString::remove`
251 - `UString::insert`
252 - `UString::insert_ustr`
253 - `UString::split_off`
254 - `UCString::as_mut_ucstr`
255 - `UCString::into_ustring`
256 - `UCString::into_ustring_with_nul`
257 - `U32CString::from_char_ptr_str`
258
259 ### Deprecated
260 - Deprecated functions as part of simplifying to increase clarity. These will be removed entirely
261 in a future release.
262 - `MissingNulError`. Use `error::MissingNulTerminator` instead.
263 - `FromUtf32Error`. Use `error::FromUtf32Error` instead.
264 - `NulError`. Use `error::ContainsNul` instead.
265 - `UCStr::from_ptr_with_nul`. Use `from_ptr_unchecked` instead.
266 - `UCStr::from_slice_with_nul`. Use `from_slice_truncate` instead.
267 - `UCStr::from_slice_with_nul_unchecked`. Use `from_slice_unchecked` instead.
268 - `U32CStr::from_char_ptr_with_nul`. Use `from_char_ptr_unchecked` instead.
269 - `U32CStr::from_char_slice_with_nul`. Use `from_char_slice_truncate` instead.
270 - `U32CStr::from_char_slice_with_nul_unchecked`. Use `from_char_slice_unchecked` instead.
271 - `UCString::new`. Use `from_vec` instead.
272 - `UCString::from_vec_with_nul_unchecked`. Use `from_vec_unchecked` instead.
273 - `UCString::from_ustr_with_nul_unchecked`. Use `from_ustr_unchecked` instead.
274 - `UCString::from_ptr_with_nul_unchecked`. Use `from_ptr_unchecked` instead.
275 - `UCString::from_str_with_nul_unchecked`. Use `from_str_unchecked` instead.
276 - `UCString::from_os_str_with_nul_unchecked`. Use `from_os_str_unchecked` instead.
277 - `UCString::from_vec_with_nul`. Use `from_vec_truncate` instead.
278 - `UCString::from_ustr_with_nul`. Use `from_ustr_truncate` instead.
279 - `UCString::from_ptr_with_nul`. Use `from_ptr_truncate` instead.
280 - `UCString::from_str_with_nul`. Use `from_str_truncate` instead.
281 - `UCString::from_os_str_with_nul`. Use `from_os_str_truncate` instead.
282 - `U32CString::from_chars_with_nul_unchecked`. Use `from_chars_unchecked` instead.
283 - `U32CString::from_char_ptr_with_nul_unchecked`. Use `from_char_ptr_unchecked` instead.
284 - `U32CString::from_chars_with_nul`. Use `from_chars_truncate` instead.
285 - `U32CString::from_char_ptr_with_nul`. Use `from_char_ptr_truncate` instead.
286 - Deprecated error types in the crate root. Use the errors directly from `error` module instead.
287
288 ## [0.4.3] - 2020-10-05 <a name="0.4.3"></a>
289 ### Fixed
290 - Fixed undefined behaviours and cleaned up clippy warnings. By [@joshwd36].
291
292 ## [0.4.2] - 2020-06-09 <a name="0.4.2"></a>
293 ### Fixed
294 - Fixed compile errors on pre-1.36.0 Rust due to unstable `alloc` crate. Minimum supported version
295 is Rust 1.34.2, the rust version for Debian stable. Fixes [#14].
296
297 ## [0.4.1] - 2020-06-08 <a name="0.4.1"></a>
298 ### ***Yanked***
299 ### Changed
300 - Now supports `no_std`. Added the `std` and `alloc` features, enabled by default. `U16String`,
301 `U32String`, `U16CString`, and `U32CString` and their aliases all require the `alloc` or `std`
302 feature. By [@nicbn].
303
304 ## [0.4.0] - 2018-08-18 <a name="0.4.0"></a>
305 ### Added
306 - New `U32String`, `U32Str`, `U32CString`, and `U32CStr` types for dealing with UTF-32 FFI. These
307 new types are roughly equivalent to the existing UTF-16 types.
308 - `WideChar` is a type alias to `u16` on Windows but `u32` on non-Windows platforms.
309 - The generic types `UString`, `UStr`, `UCString` and `UCStr` are used to implement the string
310 types.
311
312 ### Changed
313 - **Breaking Change** Existing wide string types have been renamed to `U16String`, `U16Str`,
314 `U16CString`, and `U16CStr` (previously `WideString`, `WideStr`, etc.). Some function have
315 also been renamed to reflect this change (`wide_str` to `u16_str`, etc.).
316 - **Breaking Change** `WideString`, `WideStr`, `WideCString`, and `WideCStr` are now type aliases
317 that vary between platforms. On Windows, these are aliases to the `U16` types and are equivalent
318 to the previous version, but on non-Windows platforms these alias the new `U32` types instead.
319 See crate documentation for more details.
320
321 ## [0.3.0] - 2018-03-17 <a name="0.3.0"></a>
322 ### Added
323 - Additional unchecked functions on `WideCString`.
324 - All types now implement `Default`.
325 - `WideString::shrink_to_fit`
326 - `WideString::into_boxed_wide_str` and `Box<WideStr>::into_wide_string`.
327 - `WideCString::into_boxed_wide_c_str` and `Box<WideCStr>::into_wide_c_string`.
328 - `From` and `Default` implementations for boxed `WideStr` and boxed `WideCStr`.
329
330 ### Changed
331 - Renamed `WideCString::from_vec` to replace `WideCString::new`. To create empty string, use
332 `WideCString::default()` now.
333 - `WideCString` now implements `Drop`, which sets the string to an empty string to prevent invalid
334 unsafe code from working correctly when it should otherwise break. Also see `Drop` implementation
335 of `CString`.
336 - Writing changelog manually.
337 - Upgraded winapi dev dependency.
338 - Now requires at least Rust 1.17+ to compile (previously, was Rust 1.8).
339
340 ## [0.2.2] - 2016-09-09 <a name="0.2.2"></a>
341 ### Fixed
342 - Make `WideCString::into_raw` correctly forget the original self.
343
344 ## [0.2.1] - 2016-08-12 <a name="0.2.1"></a>
345 ### Added
346 - `into_raw`/`from_raw` on `WideCString`. Closes [#2].
347
348 ## [0.2.0] - 2016-05-31 <a name="0.2.0"></a>
349 ### Added
350 - `Default` trait to wide strings.
351 - Traits for conversion of strings to `Cow`.
352 ### Changed
353 - Methods & traits to bring to parity with Rust 1.9 string APIs.
354
355 ## 0.1.0 - 2016-02-06 <a name="0.1.0"></a>
356 ### Added
357 - Initial release.
358
359 [#2]: https://github.com/VoidStarKat/widestring-rs/issues/2
360 [#14]: https://github.com/VoidStarKat/widestring-rs/issues/14
361 [#18]: https://github.com/VoidStarKat/widestring-rs/issues/18
362 [#19]: https://github.com/VoidStarKat/widestring-rs/issues/19
363 [#20]: https://github.com/VoidStarKat/widestring-rs/issues/20
364 [#22]: https://github.com/VoidStarKat/widestring-rs/issues/22
365 [#28]: https://github.com/VoidStarKat/widestring-rs/issues/28
366 [#37]: https://github.com/VoidStarKat/widestring-rs/issues/37
367 [#38]: https://github.com/VoidStarKat/widestring-rs/issues/38
368 [#33]: https://github.com/VoidStarKat/widestring-rs/issues/33
369 [#39]: https://github.com/VoidStarKat/widestring-rs/issues/39
370 [#40]: https://github.com/VoidStarKat/widestring-rs/issues/40
371 [#46]: https://github.com/VoidStarKat/widestring-rs/issues/46
372
373 [@nicbn]: https://github.com/nicbn
374 [@joshwd36]: https://github.com/joshwd36
375 [@yescallop]: https://github.com/yescallop
376 [@OpenByteDev]: https://github.com/OpenByteDev
377 [@daxpedda]: https://github.com/daxpedda
378 [@mr-adult]: https://github.com/mr-adult
379 [@syrflover]: https://github.com/syrflover
380
381 [Unreleased]: https://github.com/VoidStarKat/widestring-rs/compare/v1.2.0...HEAD
382 [1.2.0]: https://github.com/VoidStarKat/widestring-rs/compare/v1.1.0...v1.2.0
383 [1.1.0]: https://github.com/VoidStarKat/widestring-rs/compare/v1.0.2...v1.1.0
384 [1.0.2]: https://github.com/VoidStarKat/widestring-rs/compare/v1.0.1...v1.0.2
385 [1.0.1]: https://github.com/VoidStarKat/widestring-rs/compare/v1.0.0...v1.0.1
386 [1.0.0]: https://github.com/VoidStarKat/widestring-rs/compare/v1.0.0-beta.1...v1.0.0
387 [1.0.0-beta.1]: https://github.com/VoidStarKat/widestring-rs/compare/v0.5.1...v1.0.0-beta.1
388 [0.5.1]: https://github.com/VoidStarKat/widestring-rs/compare/v0.5.0...v0.5.1
389 [0.5.0]: https://github.com/VoidStarKat/widestring-rs/compare/v0.4.3...v0.5.0
390 [0.4.3]: https://github.com/VoidStarKat/widestring-rs/compare/v0.4.2...v0.4.3
391 [0.4.2]: https://github.com/VoidStarKat/widestring-rs/compare/v0.4.1...v0.4.2
392 [0.4.1]: https://github.com/VoidStarKat/widestring-rs/compare/v0.4.0...v0.4.1
393 [0.4.0]: https://github.com/VoidStarKat/widestring-rs/compare/v0.3.0...v0.4.0
394 [0.3.0]: https://github.com/VoidStarKat/widestring-rs/compare/v0.2.2...v0.3.0
395 [0.2.2]: https://github.com/VoidStarKat/widestring-rs/compare/v0.2.1...v0.2.2
396 [0.2.1]: https://github.com/VoidStarKat/widestring-rs/compare/v0.2.0...v0.2.1
397 [0.2.0]: https://github.com/VoidStarKat/widestring-rs/compare/v0.1.0...v0.2.0