Commit 11c15a6 1 parent a92373a commit 11c15a6 Copy full SHA for 11c15a6
File tree 4 files changed +16
-6
lines changed
4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,9 @@ features = ["js"]
211
211
package = " getrandom"
212
212
version = " 0.2.15"
213
213
214
+ [patch .crates-io ]
215
+ bytes = { git = " https://github.com/wyfo/arc-slice.git" }
216
+
214
217
[workspace .lints .rust ]
215
218
macro_use_extern_crate = " deny"
216
219
redundant_lifetimes = " deny"
Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ impl<T> BufferMut<T> {
228
228
/// ```
229
229
#[ inline]
230
230
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 ( ) } ;
232
232
unsafe {
233
233
std:: slice:: from_raw_parts_mut (
234
234
dst as * mut MaybeUninit < T > ,
@@ -290,7 +290,7 @@ impl<T> BufferMut<T> {
290
290
where
291
291
T : Copy ,
292
292
{
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 ( ) } ;
294
294
// SAFETY: we checked the capacity in the reserve call
295
295
unsafe {
296
296
let end = dst. add ( n) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ impl<T> BufferMut<T> {
13
13
14
14
let remaining = self . capacity ( ) - self . len ( ) ;
15
15
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 ( ) } ;
17
17
let mut dst: * mut T = begin. cast_mut ( ) ;
18
18
for _ in 0 ..remaining {
19
19
if let Some ( item) = iter. next ( ) {
@@ -42,7 +42,7 @@ impl<T> BufferMut<T> {
42
42
let ( _, high) = iter. size_hint ( ) ;
43
43
self . reserve ( high. vortex_expect ( "TrustedLen iterator didn't have valid upper bound" ) ) ;
44
44
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 ( ) } ;
46
46
let mut dst: * mut T = begin. cast_mut ( ) ;
47
47
iter. for_each ( |item| {
48
48
unsafe {
You can’t perform that action at this time.
0 commit comments