Skip to content

Commit e7d4048

Browse files
committed
Merge branch 'fix-ci'
2 parents ec1501b + 58bf89c commit e7d4048

File tree

3 files changed

+50
-53
lines changed

3 files changed

+50
-53
lines changed

.travis.yml

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,33 @@
11
sudo: false
2-
32
language: rust
4-
5-
cache: cargo
6-
7-
addons:
8-
apt:
9-
sources:
10-
- kalakris-cmake
11-
packages:
12-
- cmake
13-
- libcurl4-openssl-dev
14-
- libelf-dev
15-
- libdw-dev
16-
- binutils-dev
17-
183
rust:
19-
- 1.15.0
20-
- 1.16.0
4+
- 1.23.0 # oldest supported version
215
- stable
226
- beta
237
- nightly
248

25-
before_script:
26-
- pip install 'travis-cargo<0.2' --user
27-
- export PATH=$HOME/.local/bin:$PATH
28-
- |
29-
if [ $TRAVIS_RUST_VERSION = "stable" ]; then
30-
cargo install cargo-update
31-
export PATH=$HOME/.cargo/bin:$PATH
32-
cargo install-update --allow-no-update rustfmt cargo-update
33-
fi
9+
matrix:
10+
include:
11+
- env: RUSTFMT
12+
rust: 1.28.0
13+
install:
14+
- rustup component add rustfmt-preview
15+
script:
16+
- cargo fmt --all -- --check
17+
- env: RUSTFLAGS="-D warnings"
18+
rust: 1.28.0
19+
script:
20+
- cargo check --all --tests
21+
22+
install:
23+
- rustc -Vv
24+
- cargo -V
3425

3526
script:
36-
- travis-cargo build
37-
- travis-cargo test
38-
- travis-cargo bench
39-
- travis-cargo --only stable doc -- --no-deps
40-
- travis-cargo --only stable fmt
27+
- cargo check --verbose --no-default-features
28+
- cargo check --all --verbose
29+
- cargo test --all --verbose
30+
- cargo doc --all --no-deps
4131

42-
after_success:
43-
- travis-cargo coveralls --no-sudo --verify
32+
cache:
33+
cargo: true

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ license = "MIT"
1212
build = "build.rs"
1313

1414
[build-dependencies]
15-
skeptic = "0.9"
15+
skeptic = "0.13"
1616

1717
[dev-dependencies]
18-
skeptic = "0.9"
18+
skeptic = "0.13"
1919

2020
[features]
2121
unstable = []

src/lib.rs

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#![crate_type = "lib"]
2727
#![crate_name = "fixedvec"]
28-
2928
#![no_std]
3029

3130
//! Heapless Vec implementation using only libcore
@@ -150,10 +149,10 @@ extern crate std;
150149
/// ```
151150
#[macro_export]
152151
macro_rules! alloc_stack {
153-
([$item_type:ty; $len:expr]) => ({
154-
let space: [$item_type; $len] = [ Default::default() ; $len ];
152+
([$item_type:ty; $len:expr]) => {{
153+
let space: [$item_type; $len] = [Default::default(); $len];
155154
space
156-
})
155+
}};
157156
}
158157

159158
pub type Result<T> = core::result::Result<T, ErrorKind>;
@@ -173,7 +172,8 @@ pub use core::slice::Iter;
173172
pub use core::slice::IterMut;
174173

175174
impl<'a, T> FixedVec<'a, T>
176-
where T: 'a + Copy
175+
where
176+
T: 'a + Copy,
177177
{
178178
/// Create a new `FixedVec` from the provided slice, in the process taking
179179
/// ownership of the slice.
@@ -540,7 +540,8 @@ impl<'a, T> FixedVec<'a, T>
540540
/// # }
541541
/// ```
542542
pub fn map_in_place<F>(&mut self, f: F)
543-
where F: Fn(&mut T)
543+
where
544+
F: Fn(&mut T),
544545
{
545546
for i in 0..self.len {
546547
f(&mut self.memory[i]);
@@ -573,7 +574,6 @@ impl<'a, T> FixedVec<'a, T>
573574
slice.iter()
574575
}
575576

576-
577577
/// Provides a mutable forward iterator.
578578
///
579579
/// # Example
@@ -595,7 +595,7 @@ impl<'a, T> FixedVec<'a, T>
595595
/// ```
596596
#[inline]
597597
pub fn iter_mut(&mut self) -> IterMut<T> {
598-
let (mut slice, _) = self.memory.split_at_mut(self.len);
598+
let (slice, _) = self.memory.split_at_mut(self.len);
599599
slice.iter_mut()
600600
}
601601

@@ -690,7 +690,8 @@ impl<'a, T> FixedVec<'a, T>
690690
/// # }
691691
/// ```
692692
pub fn retain<F>(&mut self, f: F)
693-
where F: Fn(&T) -> bool
693+
where
694+
F: Fn(&T) -> bool,
694695
{
695696
let mut head: usize = 0;
696697
let mut tail: usize = 0;
@@ -807,7 +808,8 @@ impl<'a, T> FixedVec<'a, T>
807808
}
808809

809810
impl<'a, T> FixedVec<'a, T>
810-
where T: 'a + Copy + PartialEq<T>
811+
where
812+
T: 'a + Copy + PartialEq<T>,
811813
{
812814
/// Removes consecutive repeated elements in the vector in O(N) time.
813815
///
@@ -859,13 +861,14 @@ impl<'a, T: Copy> IntoIterator for &'a mut FixedVec<'a, T> {
859861
type Item = &'a mut T;
860862
type IntoIter = IterMut<'a, T>;
861863

862-
fn into_iter(mut self) -> IterMut<'a, T> {
864+
fn into_iter(self) -> IterMut<'a, T> {
863865
self.iter_mut()
864866
}
865867
}
866868

867869
impl<'a, T> Hash for FixedVec<'a, T>
868-
where T: Copy + Hash
870+
where
871+
T: Copy + Hash,
869872
{
870873
#[inline]
871874
fn hash<H: Hasher>(&self, state: &mut H) {
@@ -874,7 +877,8 @@ impl<'a, T> Hash for FixedVec<'a, T>
874877
}
875878

876879
impl<'a, T> Extend<T> for FixedVec<'a, T>
877-
where T: Copy
880+
where
881+
T: Copy,
878882
{
879883
fn extend<I: IntoIterator<Item = T>>(&mut self, iterable: I) {
880884
if self.available() == 0 {
@@ -891,7 +895,8 @@ impl<'a, T> Extend<T> for FixedVec<'a, T>
891895
}
892896

893897
impl<'a, T> ops::Index<usize> for FixedVec<'a, T>
894-
where T: Copy
898+
where
899+
T: Copy,
895900
{
896901
type Output = T;
897902

@@ -902,7 +907,8 @@ impl<'a, T> ops::Index<usize> for FixedVec<'a, T>
902907
}
903908

904909
impl<'a, T> ops::IndexMut<usize> for FixedVec<'a, T>
905-
where T: Copy
910+
where
911+
T: Copy,
906912
{
907913
#[inline]
908914
fn index_mut(&mut self, index: usize) -> &mut T {
@@ -911,7 +917,8 @@ impl<'a, T> ops::IndexMut<usize> for FixedVec<'a, T>
911917
}
912918

913919
impl<'a, T> PartialEq for FixedVec<'a, T>
914-
where T: Copy + PartialEq
920+
where
921+
T: Copy + PartialEq,
915922
{
916923
fn eq(&self, other: &FixedVec<'a, T>) -> bool {
917924
if self.len() != other.len() {
@@ -927,9 +934,9 @@ impl<'a, T> Eq for FixedVec<'a, T> where T: Copy + Eq {}
927934
#[cfg(test)]
928935
mod test {
929936
use super::FixedVec;
930-
use std::prelude::v1::*;
931-
use std::hash::Hash;
932937
use std::collections::hash_map::DefaultHasher;
938+
use std::hash::Hash;
939+
use std::prelude::v1::*;
933940

934941
#[test]
935942
fn test_empty_array() {

0 commit comments

Comments
 (0)