Skip to content

Commit 3f9f5a1

Browse files
authored
Merge pull request #527 from kariy/main
feat(string): make `from_utf8_unchecked` const
2 parents 96af9f7 + 152a55e commit 3f9f5a1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3939
- Added `SortedLinkedListView`, the `!Sized` version of `SortedLinkedList`.
4040
- Added implementation of `Borrow` and `BorrowMut` for `String` and `Vec`.
4141
- Added `Deque::{swap, swap_unchecked, swap_remove_front, swap_remove_back}`.
42+
- Make `String::from_utf8_unchecked` const.
4243

4344
### Changed
4445

src/string/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ impl<const N: usize> String<N> {
237237
/// assert_eq!("💖", sparkle_heart);
238238
/// ```
239239
#[inline]
240-
pub unsafe fn from_utf8_unchecked(vec: Vec<u8, N>) -> Self {
240+
pub const unsafe fn from_utf8_unchecked(vec: Vec<u8, N>) -> Self {
241241
Self { vec }
242242
}
243243

0 commit comments

Comments
 (0)