diff --git a/compio-io/src/read/ext.rs b/compio-io/src/read/ext.rs index 88ad00baa..94f69a542 100644 --- a/compio-io/src/read/ext.rs +++ b/compio-io/src/read/ext.rs @@ -304,7 +304,7 @@ pub trait AsyncReadAtExt: AsyncReadAt { /// Read all bytes as [`String`] until EOF in this source, placing them into /// `buffer`. - async fn read_to_string_at(&mut self, buf: String, pos: u64) -> BufResult { + async fn read_to_string_at(&self, buf: String, pos: u64) -> BufResult { let BufResult(res, buf) = self.read_to_end_at(buf.into_bytes(), pos).await; after_read_to_string(res, buf) } diff --git a/compio-io/tests/io.rs b/compio-io/tests/io.rs index 77486eb74..e1e3fbcc2 100644 --- a/compio-io/tests/io.rs +++ b/compio-io/tests/io.rs @@ -461,7 +461,7 @@ fn read_to_string_at() { block_on(async { let mut src = vec![1, 1]; src.extend_from_slice("test".as_bytes()); - let mut src = ReadOneAt(src); + let src = ReadOneAt(src); let (len, buf) = src.read_to_string_at(String::new(), 2).await.unwrap(); assert_eq!(len, 4);