Skip to content

Commit 11c15a6

Browse files
committed
try it out
1 parent a92373a commit 11c15a6

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

Cargo.lock

+9-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ features = ["js"]
211211
package = "getrandom"
212212
version = "0.2.15"
213213

214+
[patch.crates-io]
215+
bytes = { git = "https://github.com/wyfo/arc-slice.git" }
216+
214217
[workspace.lints.rust]
215218
macro_use_extern_crate = "deny"
216219
redundant_lifetimes = "deny"

vortex-buffer/src/buffer_mut.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl<T> BufferMut<T> {
228228
/// ```
229229
#[inline]
230230
pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>] {
231-
let dst = self.bytes.spare_capacity_mut().as_mut_ptr();
231+
let dst = unsafe { self.bytes.spare_capacity_mut().as_mut_ptr() };
232232
unsafe {
233233
std::slice::from_raw_parts_mut(
234234
dst as *mut MaybeUninit<T>,
@@ -290,7 +290,7 @@ impl<T> BufferMut<T> {
290290
where
291291
T: Copy,
292292
{
293-
let mut dst: *mut T = self.bytes.spare_capacity_mut().as_mut_ptr().cast();
293+
let mut dst: *mut T = unsafe { self.bytes.spare_capacity_mut().as_mut_ptr().cast() };
294294
// SAFETY: we checked the capacity in the reserve call
295295
unsafe {
296296
let end = dst.add(n);

vortex-buffer/src/spec_extend.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ impl<T> BufferMut<T> {
1313

1414
let remaining = self.capacity() - self.len();
1515

16-
let begin: *const T = self.bytes.spare_capacity_mut().as_mut_ptr().cast();
16+
let begin: *const T = unsafe { self.bytes.spare_capacity_mut().as_mut_ptr().cast() };
1717
let mut dst: *mut T = begin.cast_mut();
1818
for _ in 0..remaining {
1919
if let Some(item) = iter.next() {
@@ -42,7 +42,7 @@ impl<T> BufferMut<T> {
4242
let (_, high) = iter.size_hint();
4343
self.reserve(high.vortex_expect("TrustedLen iterator didn't have valid upper bound"));
4444

45-
let begin: *const T = self.bytes.spare_capacity_mut().as_mut_ptr().cast();
45+
let begin: *const T = unsafe { self.bytes.spare_capacity_mut().as_mut_ptr().cast() };
4646
let mut dst: *mut T = begin.cast_mut();
4747
iter.for_each(|item| {
4848
unsafe {

0 commit comments

Comments
 (0)