Add feature to support platforms without atomic CAS (#467)

This commit is contained in:
Taiki Endo
2025-01-31 18:52:54 +09:00
committed by GitHub
parent 71824b095c
commit 16fd473d5c
7 changed files with 53 additions and 6 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
use crate::buf::{IntoIter, UninitSlice};
use crate::{Buf, BufMut, Bytes};
use crate::{Buf, BufMut};
#[cfg(feature = "std")]
use std::io::IoSlice;
@@ -169,7 +169,7 @@ where
n
}
fn copy_to_bytes(&mut self, len: usize) -> Bytes {
fn copy_to_bytes(&mut self, len: usize) -> crate::Bytes {
let a_rem = self.a.remaining();
if a_rem >= len {
self.a.copy_to_bytes(len)
+2 -2
View File
@@ -1,4 +1,4 @@
use crate::{Buf, Bytes};
use crate::Buf;
use core::cmp;
@@ -148,7 +148,7 @@ impl<T: Buf> Buf for Take<T> {
self.limit -= cnt;
}
fn copy_to_bytes(&mut self, len: usize) -> Bytes {
fn copy_to_bytes(&mut self, len: usize) -> crate::Bytes {
assert!(len <= self.remaining(), "`len` greater than remaining");
let r = self.inner.copy_to_bytes(len);