From beddc4da8d2754f6eae20465c203c71780ea053c Mon Sep 17 00:00:00 2001 From: wangboo <5417808+wangboa@user.noreply.gitee.com> Date: Tue, 13 Dec 2022 18:39:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dfrom=5Fbuf=E7=9A=84bug,?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=86=85=E5=AD=98=E6=8B=B7=E8=B4=9D=E7=9A=84?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/slice.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/slice.rs b/src/util/slice.rs index fd12e02..b767f8d 100644 --- a/src/util/slice.rs +++ b/src/util/slice.rs @@ -24,7 +24,7 @@ impl Default for Slice { impl Slice { /// 从 &mut [u8] 转到 Slice, 这里存在内存拷贝开销 - pub fn from_buf(buf: &mut [u8]) -> Self { + pub fn from_buf(buf: &[u8]) -> Self { Self { data: buf.to_owned() } -- Gitee