mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Use full RocStr capacity when making small str
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
This commit is contained in:
parent
b42b20ad69
commit
4e0f591f8e
1 changed files with 1 additions and 1 deletions
|
@ -320,7 +320,7 @@ impl RocStr {
|
|||
|
||||
pub fn from_slice_with_capacity(slice: &[u8], capacity: usize) -> RocStr {
|
||||
assert!(slice.len() <= capacity);
|
||||
if capacity < core::mem::size_of::<usize>() {
|
||||
if capacity < core::mem::size_of::<RocStr>() {
|
||||
let mut rocstr = RocStr::empty();
|
||||
let target_ptr = rocstr.get_small_str_ptr_mut();
|
||||
let source_ptr = slice.as_ptr() as *const u8;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue