Skip to content

Commit c751c22

Browse files
committed
Remove old Array and Index traits
1 parent f2e9378 commit c751c22

File tree

5 files changed

+5
-165
lines changed

5 files changed

+5
-165
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- rust: 1.51.0 # MSRV
2121
features: serde
2222
- rust: stable
23-
features: array-sizes-33-128 array-sizes-129-255
23+
features:
2424
- rust: beta
2525
features: serde
2626
- rust: nightly

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 & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
//! - `serde`
1111
//! - Optional
1212
//! - Enable serialization for ArrayVec and ArrayString using serde 1.x
13-
//! - `array-sizes-33-128`, `array-sizes-129-255`
14-
//! - Optional
15-
//! - Enable more array sizes (see [Array] for more information)
1613
//!
1714
//! - `unstable-const-fn`
1815
//! - Optional
@@ -34,14 +31,12 @@ extern crate serde;
3431
#[cfg(not(feature="std"))]
3532
extern crate core as std;
3633

37-
mod array;
3834
mod arrayvec_impl;
3935
mod arrayvec;
4036
mod array_string;
4137
mod char;
4238
mod errors;
4339

44-
pub use crate::array::Array;
4540
pub use crate::array_string::ArrayString;
4641
pub use crate::errors::CapacityError;
4742

0 commit comments

Comments
 (0)