Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tafia committed Mar 14, 2020
1 parent 10c3dd6 commit a41c1da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
extern crate nested;
extern crate test;

use test::Bencher;
use nested::Nested;
use test::Bencher;

/// A function which reads src/lib.rs and return a String.
///
Expand All @@ -24,7 +24,8 @@ fn src_lib() -> String {
fn bench_vec_string(b: &mut Bencher) {
let src = src_lib();
b.iter(|| {
let words = src.split_whitespace()
let words = src
.split_whitespace()
.map(|s| s.to_string())
.collect::<Vec<_>>();
assert!(words.len() > 1000)
Expand All @@ -44,7 +45,8 @@ fn bench_nested_string(b: &mut Bencher) {
fn bench_vec_string_iter(b: &mut Bencher) {
let src = src_lib();
b.iter(|| {
let words = src.split_whitespace()
let words = src
.split_whitespace()
.map(|s| s.to_string())
.collect::<Vec<_>>();
assert!(words.len() > 1000);
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
//! assert_eq!(v.pop(), Some("a".to_string()));
//! assert_eq!(v.pop(), None);
//! ```
use std::ops::{Index, Range};
use std::iter::{repeat, FromIterator};
use std::ops::{Index, Range};

/// A `Nested` item when `T: Collection`
pub type Item<T> = <T as Index<Range<usize>>>::Output;
Expand Down

0 comments on commit a41c1da

Please sign in to comment.