Skip to content

Commit 5051065

Browse files
committed
Remove old Array and Index traits
1 parent ca51f40 commit 5051065

File tree

4 files changed

+4
-161
lines changed

4 files changed

+4
-161
lines changed

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ default = ["std"]
3939
std = []
4040
unstable-const-fn = []
4141

42-
array-sizes-33-128 = []
43-
array-sizes-129-255 = []
44-
4542
[profile.bench]
4643
debug = true
4744
[profile.release]

src/array.rs

Lines changed: 0 additions & 151 deletions
This file was deleted.

src/arrayvec.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use std::mem::MaybeUninit;
2121
use serde::{Serialize, Deserialize, Serializer, Deserializer};
2222

2323
use crate::errors::CapacityError;
24-
use crate::array::Index;
2524
use crate::arrayvec_impl::ArrayVecImpl;
2625

2726
/// A vector with a fixed capacity.
@@ -476,7 +475,7 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
476475
/// not greater than the capacity.
477476
pub unsafe fn set_len(&mut self, length: usize) {
478477
debug_assert!(length <= self.capacity());
479-
self.len = Index::from(length);
478+
self.len = length;
480479
}
481480

482481
/// Copy and appends all elements in a slice to the `ArrayVec`.
@@ -569,7 +568,7 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
569568

570569
// Calling `set_len` creates a fresh and thus unique mutable references, making all
571570
// older aliases we created invalid. So we cannot call that function.
572-
self.len = Index::from(start);
571+
self.len = start;
573572

574573
unsafe {
575574
Drain {
@@ -761,7 +760,7 @@ impl<T, const CAP: usize> IntoIterator for ArrayVec<T, CAP> {
761760
type Item = T;
762761
type IntoIter = IntoIter<T, CAP>;
763762
fn into_iter(self) -> IntoIter<T, CAP> {
764-
IntoIter { index: Index::from(0), v: self, }
763+
IntoIter { index: 0, v: self, }
765764
}
766765
}
767766

@@ -949,7 +948,7 @@ impl<T, const CAP: usize> Extend<T> for ArrayVec<T, CAP> {
949948
value: &mut self.len,
950949
data: len,
951950
f: move |&len, self_len| {
952-
**self_len = Index::from(len);
951+
**self_len = len;
953952
}
954953
};
955954
let mut iter = iter.into_iter();

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,12 @@ extern crate serde;
3434
#[cfg(not(feature="std"))]
3535
extern crate core as std;
3636

37-
mod array;
3837
mod arrayvec_impl;
3938
mod arrayvec;
4039
mod array_string;
4140
mod char;
4241
mod errors;
4342

44-
pub use crate::array::Array;
4543
pub use crate::array_string::ArrayString;
4644
pub use crate::errors::CapacityError;
4745

0 commit comments

Comments
 (0)