Skip to content

Commit

Permalink
Yield to Clippy's idea of what a number should look like.
Browse files Browse the repository at this point in the history
  • Loading branch information
bodil committed Oct 12, 2018
1 parent b0dfd5d commit 3275e30
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
19 changes: 11 additions & 8 deletions src/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -956,9 +956,11 @@ where
None => {
out.insert(key, right_value);
}
Some(left_value) => if let Some(final_value) = f(&key, left_value, right_value) {
out.insert(key, final_value);
},
Some(left_value) => {
if let Some(final_value) = f(&key, left_value, right_value) {
out.insert(key, final_value);
}
}
}
}
out.union(self)
Expand Down Expand Up @@ -1946,7 +1948,8 @@ pub mod proptest {
.prop_map(HashMap::from)
.prop_filter("Map minimum size".to_owned(), move |m| {
m.len() >= size.start
}).boxed()
})
.boxed()
}
}

Expand All @@ -1962,11 +1965,11 @@ mod test {

#[test]
fn safe_mutation() {
let v1: HashMap<usize, usize> = HashMap::from_iter((0..131072).map(|i| (i, i)));
let v1: HashMap<usize, usize> = HashMap::from_iter((0..131_072).map(|i| (i, i)));
let mut v2 = v1.clone();
v2.insert(131000, 23);
assert_eq!(Some(&23), v2.get(&131000));
assert_eq!(Some(&131000), v1.get(&131000));
v2.insert(131_000, 23);
assert_eq!(Some(&23), v2.get(&131_000));
assert_eq!(Some(&131_000), v1.get(&131_000));
}

#[test]
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@
#![deny(unsafe_code)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::type_complexity))]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
#![cfg_attr(has_specialisation, feature(specialization))]
#![cfg_attr(docs_rs_workaround, feature(slice_get_slice))]

Expand Down
8 changes: 4 additions & 4 deletions src/ord/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2004,11 +2004,11 @@ mod test {

#[test]
fn safe_mutation() {
let v1 = OrdMap::from_iter((0..131072).map(|i| (i, i)));
let v1 = OrdMap::from_iter((0..131_072).map(|i| (i, i)));
let mut v2 = v1.clone();
v2.insert(131000, 23);
assert_eq!(Some(&23), v2.get(&131000));
assert_eq!(Some(&131000), v1.get(&131000));
v2.insert(131_000, 23);
assert_eq!(Some(&23), v2.get(&131_000));
assert_eq!(Some(&131_000), v1.get(&131_000));
}

#[test]
Expand Down
6 changes: 3 additions & 3 deletions src/vector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2349,20 +2349,20 @@ mod test {

#[test]
fn large_vector_focus() {
let input = Vector::from_iter(0..100000);
let input = Vector::from_iter(0..100_000);
let vec = input.clone();
let mut sum: i64 = 0;
let mut focus = vec.focus();
for i in 0..input.len() {
sum += *focus.index(i);
}
let expected: i64 = (0..100000).sum();
let expected: i64 = (0..100_000).sum();
assert_eq!(expected, sum);
}

#[test]
fn large_vector_focus_mut() {
let input = Vector::from_iter(0..100000);
let input = Vector::from_iter(0..100_000);
let mut vec = input.clone();
{
let mut focus = vec.focus_mut();
Expand Down

0 comments on commit 3275e30

Please sign in to comment.