Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New modifications #155

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
language: rust
rust:
- 1.20.0
#- 1.36.0
- nightly
- beta
- stable
script: |
cargo build --verbose &&
cargo test --verbose &&
cargo test --verbose --features serde &&
([ $TRAVIS_RUST_VERSION != nightly ] || cargo check --verbose --no-default-features) &&
([ $TRAVIS_RUST_VERSION != nightly ] || cargo test --verbose --features union) &&
([ $TRAVIS_RUST_VERSION != nightly ] || cargo test --verbose --all-features) &&
([ $TRAVIS_RUST_VERSION != nightly ] || cargo bench --verbose bench)
#- stable
script:
- pushd ./scripts
- ./test-stable.sh
- ([ $TRAVIS_RUST_VERSION != nightly ] || ./test-nightly.sh)
- popd
33 changes: 17 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
[package]
name = "smallvec"
version = "0.6.10"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
license = "MIT/Apache-2.0"
repository = "https://github.com/servo/rust-smallvec"
categories = ["data-structures"]
description = "'Small vector' optimization: store up to a small number of items on the stack"
documentation = "https://doc.servo.org/smallvec/"
edition = "2018"
keywords = ["small", "vec", "vector", "stack", "no_std"]
categories = ["data-structures"]
license = "MIT/Apache-2.0"
name = "smallvec"
readme = "README.md"
documentation = "https://doc.servo.org/smallvec/"
repository = "https://github.com/servo/rust-smallvec"
version = "0.6.10"

[dependencies]
serde = { version = "1", optional = true }

[dev_dependencies]
bincode = "1.0.1"

[features]
const_generics = []
may_dangle = []
specialization = []
std = []
union = []
default = ["std"]
specialization = []
may_dangle = []

[lib]
name = "smallvec"
path = "lib.rs"

[dependencies]
serde = { version = "1", optional = true }

[dev_dependencies]
bincode = "1.0.1"
path = "lib.rs"
14 changes: 8 additions & 6 deletions benches/bench.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#![feature(test)]

#[macro_use]
extern crate smallvec;
extern crate test;

use self::test::Bencher;
use smallvec::{ExtendFromSlice, SmallVec};
use test::Bencher;
use smallvec::{smallvec, ExtendFromSlice, SmallVec};

const VEC_SIZE: usize = 16;
const SPILLED_SIZE: usize = 100;
Expand Down Expand Up @@ -273,7 +271,11 @@ fn bench_insert_from_slice(b: &mut Bencher) {
#[bench]
fn bench_macro_from_list(b: &mut Bencher) {
b.iter(|| {
let vec: SmallVec<[u64; 16]> = smallvec![
#[cfg(feature = "const_generics")]
let vec: SmallVec<u64, 16>;
#[cfg(not(feature = "const_generics"))]
let vec: SmallVec<[u64; 16]>;
vec = smallvec![
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 24, 32, 36, 0x40, 0x80,
0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000, 0x10000, 0x20000, 0x40000,
0x80000, 0x100000,
Expand All @@ -292,4 +294,4 @@ fn bench_macro_from_list_vec(b: &mut Bencher) {
];
vec
});
}
}
Loading