summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortummychow <tummychow@users.noreply.github.com>2018-03-11 01:14:58 -0800
committertummychow <tummychow@users.noreply.github.com>2018-03-11 01:14:58 -0800
commit530fbf2464356469e678551c5033685faa8d280a (patch)
tree965a3f8816b9e29968cf0b05f65f1851d3c2fb8a
parenta393a56c2a765c28fd96d1fdc31d0d113c1b519e (diff)
remove superfluous deref
this is a very cute trick, but also one that's easy to cargo cult incorrectly. only one deref is needed here (derefing from Rc<Vec<Vec<u8>>> to Vec<Vec<u8>>) and then a reference can be taken (&Vec<Vec<u8>>) which provides the desired into_iter. the second deref goes from Vec<Vec<u8>> to &[Vec<u8>] which is unnecessary since Vec already has an iterator over references.
-rw-r--r--src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 2446e34..9a332ef 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -191,7 +191,7 @@ fn apply_hunk_to_tree<'repo>(
post
};
// next, write the added side of the hunk
- for line in &**hunk.added.lines {
+ for line in &*hunk.added.lines {
blobwriter.write_all(line)?;
}
// if this hunk removed lines from the old content, those must be