From 9f93a770502b7e9042448c742d6b5c9630f368bd Mon Sep 17 00:00:00 2001 From: x1a0t Date: Sun, 15 Oct 2023 23:00:34 +0800 Subject: [PATCH] remove deprecated primitive type --- src/buf/buf_mut.rs | 4 ++-- src/bytes.rs | 2 +- src/bytes_mut.rs | 2 +- tests/test_buf_mut.rs | 1 - tests/test_bytes.rs | 2 -- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/buf/buf_mut.rs b/src/buf/buf_mut.rs index 304e11b13..474fedb13 100644 --- a/src/buf/buf_mut.rs +++ b/src/buf/buf_mut.rs @@ -3,7 +3,7 @@ use crate::buf::{limit, Chain, Limit, UninitSlice}; use crate::buf::{writer, Writer}; use crate::{panic_advance, panic_does_not_fit}; -use core::{mem, ptr, usize}; +use core::{mem, ptr}; use alloc::{boxed::Box, vec::Vec}; @@ -1573,7 +1573,7 @@ unsafe impl BufMut for Vec { #[inline] fn remaining_mut(&self) -> usize { // A vector can never have more than isize::MAX bytes - core::isize::MAX as usize - self.len() + isize::MAX as usize - self.len() } #[inline] diff --git a/src/bytes.rs b/src/bytes.rs index d8911bba1..4e590fc05 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -1,6 +1,6 @@ use core::iter::FromIterator; use core::ops::{Deref, RangeBounds}; -use core::{cmp, fmt, hash, mem, ptr, slice, usize}; +use core::{cmp, fmt, hash, mem, ptr, slice}; use alloc::{ alloc::{dealloc, Layout}, diff --git a/src/bytes_mut.rs b/src/bytes_mut.rs index c8607201b..10f6ff27f 100644 --- a/src/bytes_mut.rs +++ b/src/bytes_mut.rs @@ -2,7 +2,7 @@ use core::iter::{FromIterator, Iterator}; use core::mem::{self, ManuallyDrop, MaybeUninit}; use core::ops::{Deref, DerefMut}; use core::ptr::{self, NonNull}; -use core::{cmp, fmt, hash, isize, slice, usize}; +use core::{cmp, fmt, hash, slice}; use alloc::{ borrow::{Borrow, BorrowMut}, diff --git a/tests/test_buf_mut.rs b/tests/test_buf_mut.rs index 0abeb9f7a..9eb0bffdc 100644 --- a/tests/test_buf_mut.rs +++ b/tests/test_buf_mut.rs @@ -4,7 +4,6 @@ use bytes::buf::UninitSlice; use bytes::{BufMut, BytesMut}; use core::fmt::Write; use core::mem::MaybeUninit; -use core::usize; #[test] fn test_vec_as_mut_buf() { diff --git a/tests/test_bytes.rs b/tests/test_bytes.rs index 5ec60a5b0..0f7fd3f29 100644 --- a/tests/test_bytes.rs +++ b/tests/test_bytes.rs @@ -2,8 +2,6 @@ use bytes::{Buf, BufMut, Bytes, BytesMut}; -use std::usize; - const LONG: &[u8] = b"mary had a little lamb, little lamb, little lamb"; const SHORT: &[u8] = b"hello world";