diff --git a/CHANGELOG.md b/CHANGELOG.md index e823923213..6da8139084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Added `SortedLinkedListView`, the `!Sized` version of `SortedLinkedList`. - Added implementation of `Borrow` and `BorrowMut` for `String` and `Vec`. - Added `Deque::{swap, swap_unchecked, swap_remove_front, swap_remove_back}`. +- Make `String::from_utf8_unchecked` const. ### Changed diff --git a/src/string/mod.rs b/src/string/mod.rs index 6dfe2055dc..6633580e36 100644 --- a/src/string/mod.rs +++ b/src/string/mod.rs @@ -237,7 +237,7 @@ impl String { /// assert_eq!("💖", sparkle_heart); /// ``` #[inline] - pub unsafe fn from_utf8_unchecked(vec: Vec) -> Self { + pub const unsafe fn from_utf8_unchecked(vec: Vec) -> Self { Self { vec } }