mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 13:23:09 +00:00
Remove unnecessary reference
This commit is contained in:
parent
6c37103b7c
commit
f3d59abc46
1 changed files with 2 additions and 2 deletions
|
@ -288,11 +288,11 @@ fn unescape_yaml_fish_2_0(s: &[u8]) -> Vec<u8> {
|
||||||
// performance of this function.
|
// performance of this function.
|
||||||
let to_copy = chars.by_ref().take_while(|b| *b != b'\\').count();
|
let to_copy = chars.by_ref().take_while(|b| *b != b'\\').count();
|
||||||
unsafe {
|
unsafe {
|
||||||
let src = &s[src_idx..].as_ptr();
|
let src = s[src_idx..].as_ptr();
|
||||||
// Can use the following when feature(maybe_uninit_slice) is stabilized:
|
// Can use the following when feature(maybe_uninit_slice) is stabilized:
|
||||||
// let dst = std::mem::MaybeUninit::slice_as_mut_ptr(&mut result[dst_idx..]);
|
// let dst = std::mem::MaybeUninit::slice_as_mut_ptr(&mut result[dst_idx..]);
|
||||||
let dst = result[dst_idx..].as_mut_ptr().cast();
|
let dst = result[dst_idx..].as_mut_ptr().cast();
|
||||||
std::ptr::copy_nonoverlapping(*src, dst, to_copy);
|
std::ptr::copy_nonoverlapping(src, dst, to_copy);
|
||||||
}
|
}
|
||||||
dst_idx += to_copy;
|
dst_idx += to_copy;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue