diff options
author | tummychow <tummychow@users.noreply.github.com> | 2018-03-11 01:14:58 -0800 |
---|---|---|
committer | tummychow <tummychow@users.noreply.github.com> | 2018-03-11 01:14:58 -0800 |
commit | 530fbf2464356469e678551c5033685faa8d280a (patch) | |
tree | 965a3f8816b9e29968cf0b05f65f1851d3c2fb8a | |
parent | a393a56c2a765c28fd96d1fdc31d0d113c1b519e (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.rs | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |