Skip to content

some more clippy-based improvements #28287

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

Merged
merged 5 commits into from
Sep 8, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixes/improvements thanks to @Manishearth
  • Loading branch information
llogiq committed Sep 7, 2015
commit 808390817aa50b6251e957075c22a688bc96ce9f
6 changes: 3 additions & 3 deletions src/libserialize/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@ impl Stack {
pub fn is_equal_to(&self, rhs: &[StackElement]) -> bool {
if self.stack.len() != rhs.len() { return false; }
for (i, r) in rhs.iter().enumerate() {
if &self.get(i) != r { return false; }
if self.get(i) != *r { return false; }
}
true
}
Expand All @@ -1334,7 +1334,7 @@ impl Stack {
pub fn starts_with(&self, rhs: &[StackElement]) -> bool {
if self.stack.len() < rhs.len() { return false; }
for (i, r) in rhs.iter().enumerate() {
if &self.get(i) != r { return false; }
if self.get(i) != *r { return false; }
}
true
}
Expand All @@ -1345,7 +1345,7 @@ impl Stack {
if self.stack.len() < rhs.len() { return false; }
let offset = self.stack.len() - rhs.len();
for (i, r) in rhs.iter().enumerate() {
if &self.get(i + offset) != r { return false; }
if self.get(i + offset) != *r { return false; }
}
true
}
Expand Down
3 changes: 1 addition & 2 deletions src/libstd/sys/unix/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ pub fn split_paths(unparsed: &OsStr) -> SplitPaths {
fn is_colon(b: &u8) -> bool { *b == b':' }
let unparsed = unparsed.as_bytes();
SplitPaths {
iter: unparsed.split(is_colon as fn(&u8) -> bool)
.map(bytes_to_path as fn(&[u8]) -> PathBuf)
iter: unparsed.split(is_colon).map(bytes_to_path)
}
}

Expand Down
1 change: 0 additions & 1 deletion src/libtest/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ impl Stats for [f64] {
// This inner loop applies `hi`/`lo` summation to each
// partial so that the list of partial sums remains exact.
for mut y in &mut partials {
let mut y: f64 = partials[i];
if x.abs() < y.abs() {
mem::swap(&mut x, &mut y);
}
Expand Down